Skip to content

Commit 25a7c64

Browse files
authored
Update wiki.yml
1 parent e672205 commit 25a7c64

1 file changed

Lines changed: 48 additions & 13 deletions

File tree

.github/workflows/wiki.yml

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,65 @@ jobs:
4545
php_version: '8.4'
4646
command: 'docs'
4747

48+
- name: Commit & push changes in wiki submodule
49+
id: wiki_commit
50+
working-directory: docs/wiki
51+
run: |
52+
echo "Status before commit (submodule docs/wiki):"
53+
git status --porcelain || true
54+
55+
changed="false"
56+
57+
if [ -z "$(git status --porcelain)" ]; then
58+
echo "wiki_changed=$changed" >> "$GITHUB_OUTPUT"
59+
exit 0
60+
fi
61+
62+
git config user.email "github-actions[bot]@users.noreply.github.com"
63+
git config user.name "github-actions[bot]"
64+
65+
git add .
66+
67+
if git diff --cached --quiet; then
68+
echo "wiki_changed=$changed" >> "$GITHUB_OUTPUT"
69+
exit 0
70+
fi
71+
72+
git commit -m "Update wiki docs at $(date "+%Y-%m-%d %H:%M:%S")"
73+
git push origin HEAD
74+
75+
changed="true"
76+
echo "wiki_changed=$changed" >> "$GITHUB_OUTPUT"
77+
4878
- name: Update submodules
4979
id: update
5080
run: git submodule update --remote --recursive
5181

52-
- name: Check if there are changes
82+
- name: Check if parent repo has submodule pointer changes
5383
id: changes
84+
if: steps.wiki_commit.outputs.wiki_changed == 'true'
5485
run: |
55-
git add .
56-
57-
if git diff --cached --quiet; then
58-
echo "changed=true" >> $GITHUB_OUTPUT
59-
else
60-
echo "changed=false" >> $GITHUB_OUTPUT
86+
git status --porcelain
87+
echo "wiki_changed='${{ steps.wiki_commit.outputs.wiki_changed }}'"
88+
89+
git add docs/wiki
90+
91+
changed="false"
92+
93+
if ! git diff --cached --quiet; then
94+
changed="true"
6195
fi
62-
63-
- name: Add and commit files
96+
97+
echo "changed=$changed" >> "$GITHUB_OUTPUT"
98+
99+
- name: Add and commit parent repo
64100
if: steps.changes.outputs.changed == 'true'
65101
run: |
66-
git add .
67102
git config --global user.email "github-actions[bot]@users.noreply.github.com"
68103
git config --global user.name "github-actions[bot]"
69-
git commit -m "Update submodules at $(date "+DATE: %Y-%m-%d TIME: %H:%M:%S")"
70-
71-
- name: Push changes
104+
git commit -m "Update wiki submodule pointer at $(date "+%Y-%m-%d %H:%M:%S")"
105+
106+
- name: Push changes (parent repo)
72107
if: steps.changes.outputs.changed == 'true'
73108
uses: ad-m/github-push-action@master
74109
with:

0 commit comments

Comments
 (0)