File tree 2 files changed +46
-4
lines changed
2 files changed +46
-4
lines changed Original file line number Diff line number Diff line change 7
7
branches : ["main"]
8
8
9
9
jobs :
10
- test-non-main-repo :
10
+ test-non-main-repo-fix-404 :
11
11
runs-on : ubuntu-latest
12
12
steps :
13
13
- name : Checkout
22
22
project-path : Test/Test.csproj
23
23
main-repo : false
24
24
- name : Verify
25
- run : Test/Verify.sh --non-main-repo ${{ github.event.repository.name }}
25
+ run : Test/Verify.sh --non-main-repo --fix-404 ${{ github.event.repository.name }}
26
26
27
- test-main-repo :
27
+ test-main-repo-fix-404 :
28
28
runs-on : ubuntu-latest
29
29
steps :
30
30
- name : Checkout
39
39
project-path : Test/Test.csproj
40
40
main-repo : true
41
41
- name : Verify
42
- run : Test/Verify.sh --main-repo ${{ github.event.repository.name }}
42
+ run : Test/Verify.sh --main-repo --fix-404 ${{ github.event.repository.name }}
43
+
44
+ test-non-main-repo-no-fix-404 :
45
+ runs-on : ubuntu-latest
46
+ steps :
47
+ - name : Checkout
48
+ uses : actions/checkout@v4
49
+ - name : Setup .NET
50
+ uses : actions/setup-dotnet@v4
51
+ with :
52
+ dotnet-version : 8.0.x
53
+ - name : GitHub Pages Blazor WASM
54
+ uses : ./
55
+ with :
56
+ project-path : Test/Test.csproj
57
+ main-repo : false
58
+ - name : Verify
59
+ run : Test/Verify.sh --non-main-repo --no-fix-404 ${{ github.event.repository.name }}
60
+
61
+ test-main-repo-no-fix-404 :
62
+ runs-on : ubuntu-latest
63
+ steps :
64
+ - name : Checkout
65
+ uses : actions/checkout@v4
66
+ - name : Setup .NET
67
+ uses : actions/setup-dotnet@v4
68
+ with :
69
+ dotnet-version : 8.0.x
70
+ - name : GitHub Pages Blazor WASM
71
+ uses : ./
72
+ with :
73
+ project-path : Test/Test.csproj
74
+ main-repo : true
75
+ - name : Verify
76
+ run : Test/Verify.sh --main-repo --no-fix-404 ${{ github.event.repository.name }}
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ inputs:
13
13
main-repo :
14
14
description : Set to true only when running this action from the default GitHub Pages repository ({ID}.github.io).
15
15
default : false
16
+ fix-404 :
17
+ description : Whether to apply repository-specific modifications to 404.html as well. This only takes effect when main-repo is false.
18
+ default : true
16
19
outputs :
17
20
wwwroot-path :
18
21
description : Path of wwwroot
42
45
run : sed -i 's/base href="\/"/base href="\/${{ github.event.repository.name }}\/"/g' ${{ steps.wwwroot-output.outputs.wwwroot }}/index.html
43
46
shell : bash
44
47
48
+ - name : Modify 404.html for this repository
49
+ if : ${{ inputs.main-repo == 'false' && inputs.fix-404 == 'true' }}
50
+ run : sed -i 's/\/?p=\//\/${{ github.event.repository.name }}\/?p=\//g' ${{ steps.wwwroot-output.outputs.wwwroot }}/404.html
51
+ shell : bash
52
+
45
53
- name : Create .nojekyll
46
54
run : touch ${{ steps.wwwroot-output.outputs.wwwroot }}/.nojekyll
47
55
shell : bash
You can’t perform that action at this time.
0 commit comments