From 9ffa35249b3831067a988bd9646cb7f2b29372e1 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Wed, 2 Oct 2024 17:43:04 +0200 Subject: [PATCH] fix(ci): `bashisms.yml`. again. will work all the time this time i swear. (#715) * workflow fixed * added a debug echo --- .github/workflows/bashisms.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/bashisms.yml b/.github/workflows/bashisms.yml index 7226bb5c..7ce39ef1 100644 --- a/.github/workflows/bashisms.yml +++ b/.github/workflows/bashisms.yml @@ -19,17 +19,27 @@ jobs: id: get_sh_files run: | sh_files=$(git diff --name-only origin/${{ github.base_ref }} HEAD core/tabs | grep '\.sh$' || true) - echo "::set-output name=sh_files::$sh_files" + if [ -n "$sh_files" ]; then + echo "$sh_files" > changed_files + echo "changed=1" >> $GITHUB_OUTPUT + else + echo "changed=0" >> $GITHUB_OUTPUT + fi - name: Install devscripts - if: steps.get_sh_files.outputs.sh_files != '' + if: steps.get_sh_files.outputs.changed == 1 run: sudo apt-get update && sudo apt-get install devscripts - name: Check for bashisms - if: steps.get_sh_files.outputs.sh_files != '' + if: steps.get_sh_files.outputs.changed == 1 run: | - for file in ${{ steps.get_sh_files.outputs.sh_files }}; do - if [[ -f "$file" ]]; then - checkbashisms "$file" - fi + echo "Running for:\n$(cat changed_files)\n" + for file in $(cat changed_files); do + if [[ -f "$file" ]]; then + checkbashisms "$file" + fi done + + - name: Remove the created file + if: steps.get_sh_files.outputs.changed == 1 + run: rm changed_files