build: run ShellCheck in CI (#31809)

build: run ShellCheck

Adds a ShellCheck check to edx-platform PRs and master,
using the shared workflow & template from the .github repo.
This will become a "required" check once it passes for 2 straight weeks on master.

Brings all existing shell scripts into compliance with ShellCheck.
This commit is contained in:
Kyle McCormick
2023-03-10 11:10:56 -05:00
committed by GitHub
parent 7f769b4755
commit cd24534653
7 changed files with 73 additions and 32 deletions

32
.github/workflows/shellcheck.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
# Run ShellCheck on PRs and master
# For more context, see:
# https://github.com/openedx/.github/blob/master/docs/decisions/0001-shellcheck.rst
name: ShellCheck
on:
pull_request:
push:
branches:
- master
permissions:
contents: read
jobs:
shellcheck:
strategy:
matrix:
os: ["ubuntu", "macos"]
uses: openedx/.github/.github/workflows/shellcheck.yml@master
with:
# For details on the meaning of each of these arguments, see:
# https://github.com/openedx/.github/blob/master/.github/workflows/shellcheck.yml
# We exclude `./node_modules/*` by default because we want people to easily be able to
# copy and run the command locally. Local copies of most of our services have a `./node_modules`
# directory that we want to ignore.
exclude-patterns: "./node_modules/*"
operating-system: "${{ matrix.os }}"
shellcheck-version: "v0.9.0"
#shellcheck-options: ""