Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): bashisms.yml. again. will work all the time this time i swear. #715

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .github/workflows/bashisms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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