Skip to content

Commit a7e51a9

Browse files
yaml update2
1 parent 5e56bf1 commit a7e51a9

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/sync-wiki.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ jobs:
2525
with:
2626
repository: ${{ github.repository }}.wiki
2727
path: wiki
28+
continue-on-error: true
29+
- name: Create Wiki Directory if Not Exists
30+
run: |
31+
if [ ! -d "wiki" ]; then
32+
mkdir -p wiki
33+
cd wiki
34+
git init
35+
git config user.name "${{ github.actor }}"
36+
git config user.email "${{ github.actor }}@users.noreply.github.com"
37+
git remote add origin "https://github.com/${{ github.repository }}.wiki.git"
38+
fi
2839
- name: Set up Python
2940
uses: actions/setup-python@v4
3041
with:
@@ -42,5 +53,9 @@ jobs:
4253
git config user.name "${{ github.actor }}"
4354
git config user.email "${{ github.actor }}@users.noreply.github.com"
4455
git add .
45-
git diff --quiet && git diff --staged --quiet || \
46-
(git commit -m "Auto sync wiki from main repository" && git push)
56+
if git status --porcelain | grep .; then
57+
git commit -m "Auto sync wiki from main repository"
58+
git push --set-upstream https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.wiki.git master -f
59+
else
60+
echo "No changes to commit"
61+
fi

0 commit comments

Comments
 (0)