From e5d0b2bd8496c8df68e1fd301eee2b51c973d06c Mon Sep 17 00:00:00 2001 From: ThatPeople <63274635+khuonghoanghuy@users.noreply.github.com> Date: Sun, 24 Nov 2024 08:17:14 +0700 Subject: [PATCH] Update publish-wiki.yml --- .github/workflows/publish-wiki.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-wiki.yml b/.github/workflows/publish-wiki.yml index 87f565d..0da831b 100644 --- a/.github/workflows/publish-wiki.yml +++ b/.github/workflows/publish-wiki.yml @@ -16,9 +16,22 @@ permissions: jobs: publish-wiki: runs-on: ubuntu-latest - if: github.event.head_commit.modified | contains('docs/') steps: - uses: actions/checkout@v3 - - uses: Andrew-Chen-Wang/github-wiki-action@v4 + + - name: Check if docs folder was modified + id: check_docs + run: | + if [[ $(git diff --name-only HEAD^ HEAD) =~ ^docs/ ]]; then + echo "docs folder has changed." + echo "modified=true" >> $GITHUB_ENV + else + echo "docs folder has not changed." + echo "modified=false" >> $GITHUB_ENV + fi + + - name: Publish to wiki + if: env.modified == 'true' + uses: Andrew-Chen-Wang/github-wiki-action@v4 with: path: docs/