[CI] Add shellcheck and fix up warnings (#2809)

# Motivation

We have quite a lot of shell scripts in our repo and want to make sure that they all pass `shellcheck`.

# Modification

This PR adds a GH action workflow to the soundness script for `shellcheck` and fixes up all errors and warnings.

# Result

No more shell/bash discussions
This commit is contained in:
Franz Busch authored and GitHub committed 2024-07-25 14:55:44 +00:00
1 parent 55d4c49334
commit f17f7e5909
53 files changed
+191 -319

No files matched your search

+14
View File
@@ -130,3 +130,17 @@ jobs:
run: |
apt-get -qq update && apt-get -qq -y install curl
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-swift-format.sh | bash
shell-check:
name: Shell check
if: ${{ inputs.format_check_enabled }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Mark the workspace as safe
# https://github.com/actions/checkout/issues/766
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Run shellcheck
run: git ls-files -z '*.sh' | xargs -0 shellcheck