From 08d43bfb660bc9f6553a8d81491ded527e6ae6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastiaan?= Date: Sat, 4 Jan 2025 18:13:56 +0100 Subject: [PATCH] Enable check for .func files --- .github/workflows/script-formatting.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/script-formatting.yaml b/.github/workflows/script-formatting.yaml index 26bb9848..e878ffde 100644 --- a/.github/workflows/script-formatting.yaml +++ b/.github/workflows/script-formatting.yaml @@ -7,6 +7,7 @@ on: pull_request: paths: - "**/*.sh" + - "**/*.func" jobs: shfmt: @@ -33,9 +34,9 @@ jobs: id: changed-files run: | if ${{ github.event_name == 'pull_request' }}; then - echo "files=$(git diff --name-only -r HEAD^1 HEAD | grep '\.sh$' | xargs)" >> $GITHUB_OUTPUT + echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT else - echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep '\.sh$' | xargs)" >> $GITHUB_OUTPUT + echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT fi - name: Run shfmt @@ -48,13 +49,13 @@ jobs: exit 0 else echo "diff=\"$(echo -n "$shfmt_output" | base64 -w 0)\"" >> $GITHUB_OUTPUT - echo -e $shfmt_output + printf "%s" "$shfmt_output" exit 1 fi - name: Post comment with results if: always() && github.event_name == 'pull_request' - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const result = '${{ job.status }}' === 'success' ? 'success' : 'failure';