From 6501667b41b0c821f81083a878b64340003fbe56 Mon Sep 17 00:00:00 2001 From: Franciszek Walkowiak Date: Fri, 1 Mar 2024 14:31:44 +0100 Subject: [PATCH] Try another method --- .github/workflows/spelling.yaml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/spelling.yaml b/.github/workflows/spelling.yaml index 96616ff7..0ab22234 100644 --- a/.github/workflows/spelling.yaml +++ b/.github/workflows/spelling.yaml @@ -100,30 +100,37 @@ jobs: token: ${{ steps.github-token.outputs.token }} - name: Get commit message ๐Ÿ’ฌ + id: get-commit-message run: | git config --global --add safe.directory $(pwd) export head_commit_message="$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')" + echo "head_commit_message=$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')" >> $GITHUB_OUTPUT echo "head_commit_message = $(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')" if [[ $head_commit_message == *"[skip spelling]"* ]]; then echo "Skip instruction detected." - exit 0 fi shell: bash - name: Normalize variables ๐Ÿ“ + if: > + !contains(steps.get-commit-message.outputs.head_commit_message, '[skip spelling]') }} run: | package_subdirectory_input="${{ inputs.package-subdirectory }}" echo "package_subdirectory=${package_subdirectory_input:-.}" >> $GITHUB_ENV shell: bash - name: Run Spellcheck ๐Ÿ‘Ÿ + if: > + !contains(steps.get-commit-message.outputs.head_commit_message, '[skip spelling]') }} uses: insightsengineering/r-spellcheck-action@v2 with: exclude: ${{ inputs.exclude }} path: ${{ env.package_subdirectory }} - name: Clean up WORDLIST ๐Ÿงผ - if: github.event_name == 'push' + if: > + github.event_name == 'push' && + !contains(steps.get-commit-message.outputs.head_commit_message, '[skip spelling]') }} run: | x <- readLines('inst/WORDLIST') file.remove('inst/WORDLIST') @@ -136,14 +143,18 @@ jobs: shell: Rscript {0} - name: Checkout to main ๐Ÿ›Ž - if: github.event_name == 'push' + if: > + github.event_name == 'push' && + !contains(steps.get-commit-message.outputs.head_commit_message, '[skip spelling]') }} run: | git fetch origin main git checkout main git pull origin main - name: Set file pattern to commit โš™๏ธ - if: github.event_name == 'push' + if: > + github.event_name == 'push' && + !contains(steps.get-commit-message.outputs.head_commit_message, '[skip spelling]') }} id: file-pattern run: | if [[ "${{ inputs.package-subdirectory }}" == "." ]]; then @@ -155,7 +166,9 @@ jobs: shell: bash - name: Commit and push changes ๐Ÿ“Œ - if: github.event_name == 'push' + if: > + github.event_name == 'push' && + !contains(steps.get-commit-message.outputs.head_commit_message, '[skip spelling]') }} uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "[skip ci] Update WORDLIST"