Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.5k
Merge pull request #7899 from sylvestre/selinux-build#654
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
name:CheckScripts | |
# spell-checker:ignore ludeeus mfinelli shellcheck scandir shfmt | |
env: | |
SCRIPT_DIR:'util' | |
on: | |
push: | |
branches: | |
-'*' | |
paths: | |
-'util/**/*.sh' | |
pull_request: | |
branches: | |
-main | |
paths: | |
-'util/**/*.sh' | |
# End the current execution if there is a new changeset in the PR. | |
concurrency: | |
group:${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress:${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
shell_check: | |
name:ShellScript/Check | |
runs-on:ubuntu-latest | |
permissions: | |
contents:read | |
steps: | |
-uses:actions/checkout@v4 | |
with: | |
persist-credentials:false | |
-name:Run ShellCheck | |
uses:ludeeus/action-shellcheck@master | |
env: | |
SHELLCHECK_OPTS:-s bash | |
with: | |
severity:warning | |
scandir:${{ env.SCRIPT_DIR }} | |
format:tty | |
shell_fmt: | |
name:ShellScript/Format | |
runs-on:ubuntu-latest | |
permissions: | |
contents:read | |
steps: | |
-uses:actions/checkout@v4 | |
with: | |
persist-credentials:false | |
-name:Setup shfmt | |
uses:mfinelli/setup-shfmt@v3 | |
-name:Run shfmt | |
shell:bash | |
run:| | |
# fmt options: bash syntax, 4 spaces indent, indent for switch-case | |
echo "## show the differences between formatted and original scripts..." | |
find ${{ env.SCRIPT_DIR }} -name "*.sh" -print0 | xargs -0 shfmt -ln=bash -i 4 -ci -d ||true |