Skip to content

Commit 528f46e

Browse files
committed
fix wiki update workflow
1 parent 3c60b8c commit 528f46e

File tree

4 files changed

+29
-20
lines changed

4 files changed

+29
-20
lines changed

.github/workflows/_shared-build.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
name: Build linux/amd64 binary
4747
runs-on: ubuntu-latest
4848
steps:
49-
- uses: actions/checkout@v3
49+
- uses: actions/checkout@v4
5050
with:
5151
ref: ${{ inputs.ref }}
5252

@@ -80,7 +80,7 @@ jobs:
8080
name: Build linux/arm64 binary
8181
runs-on: ubuntu-latest
8282
steps:
83-
- uses: actions/checkout@v3
83+
- uses: actions/checkout@v4
8484
with:
8585
ref: ${{ inputs.ref }}
8686

@@ -120,7 +120,7 @@ jobs:
120120
name: Build windows/amd64 binary
121121
runs-on: windows-latest
122122
steps:
123-
- uses: actions/checkout@v3
123+
- uses: actions/checkout@v4
124124
with:
125125
ref: ${{ inputs.ref }}
126126

@@ -154,7 +154,7 @@ jobs:
154154
name: Build macos/amd64 binary
155155
runs-on: macos-latest
156156
steps:
157-
- uses: actions/checkout@v3
157+
- uses: actions/checkout@v4
158158
with:
159159
ref: ${{ inputs.ref }}
160160

@@ -188,7 +188,7 @@ jobs:
188188
name: Build macos/arm64 binary
189189
runs-on: macos-latest
190190
steps:
191-
- uses: actions/checkout@v3
191+
- uses: actions/checkout@v4
192192
with:
193193
ref: ${{ inputs.ref }}
194194

@@ -224,7 +224,7 @@ jobs:
224224
if: ${{ inputs.docker }}
225225
runs-on: ubuntu-latest
226226
steps:
227-
- uses: actions/checkout@v3
227+
- uses: actions/checkout@v4
228228
with:
229229
ref: ${{ inputs.ref }}
230230

@@ -272,7 +272,7 @@ jobs:
272272
if: ${{ inputs.docker }}
273273
runs-on: ubuntu-latest
274274
steps:
275-
- uses: actions/checkout@v3
275+
- uses: actions/checkout@v4
276276
with:
277277
ref: ${{ inputs.ref }}
278278
- name: Get build version
@@ -321,7 +321,7 @@ jobs:
321321
if: ${{ inputs.docker }}
322322
runs-on: ubuntu-latest
323323
steps:
324-
- uses: actions/checkout@v3
324+
- uses: actions/checkout@v4
325325
with:
326326
ref: ${{ inputs.ref }}
327327
- name: Get build version
@@ -356,7 +356,7 @@ jobs:
356356
matrix:
357357
tag: ${{ fromJSON(inputs.additional_tags) }}
358358
steps:
359-
- uses: actions/checkout@v3
359+
- uses: actions/checkout@v4
360360
with:
361361
ref: ${{ inputs.ref }}
362362
- name: Get build version

.github/workflows/_shared-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
name: Run code checks
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313

1414
# setup global dependencies
1515
- name: Set up go

.github/workflows/build-master.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,20 @@ jobs:
4141
runs-on: ubuntu-latest
4242
steps:
4343
- name: Checkout base code
44-
uses: actions/checkout@v2
44+
uses: actions/checkout@v4
4545
with:
4646
path: code
47-
- name: Checkout wiki code
48-
uses: actions/checkout@v2
49-
with:
50-
repository: ${{github.repository}}.wiki
51-
path: wiki
47+
- name: Generate wiki from docs
48+
env:
49+
WIKI_TOKEN: ${{ secrets.WIKI_TOKEN }}
50+
run: |
51+
mkdir wiki
52+
cd wiki
53+
git init
54+
git config --local user.email "[email protected]"
55+
git config --local user.name "GitHub Action"
56+
git pull https://[email protected]/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}.wiki.git
57+
5258
- name: Generate wiki from docs
5359
run: |
5460
touch ./wiki.md
@@ -66,12 +72,15 @@ jobs:
6672
6773
cp ./wiki.md ./wiki/Home.md
6874
- name: Push to wiki
75+
env:
76+
WIKI_TOKEN: ${{ secrets.WIKI_TOKEN }}
6977
run: |
7078
cd wiki
71-
git config --local user.email "[email protected]"
72-
git config --local user.name "GitHub Action"
7379
git add .
74-
git diff-index --quiet HEAD || git commit -m "Add changes" && git push
80+
git diff-index --quiet HEAD && exit 0
81+
82+
git commit -m "Add changes"
83+
git push -f --set-upstream https://[email protected]/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}.wiki.git master
7584
7685
create_snapshot_release:
7786
name: Create snapshot release

.github/workflows/build-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
needs: [build_binaries]
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
3535
with:
3636
fetch-depth: 100
3737
ref: ${{ github.sha }}

0 commit comments

Comments
 (0)