-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add shellcheck workflow for PRs and master
Additionally, this brings all existing shell scripts into compliance with ShellCheck. This implements part of an ADR, proposed here: openedx/.github#60
- Loading branch information
1 parent
d305ab8
commit 10a3d68
Showing
7 changed files
with
106 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# ShellCheck is a linter for your shell scripts: | ||
# https://www.shellcheck.net/ | ||
# This workflow runs it on PRs and pushes to $default-branch | ||
|
||
name: ShellCheck | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
|
||
shellcheck: | ||
name: Run ShellCheck | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Check out branch | ||
uses: actions/checkout@v3 | ||
|
||
# Run ShellCheck using a predefine action: | ||
# https://github.com/marketplace/actions/shellcheck | ||
- name: Run ShellCheck | ||
uses: ludeeus/action-shellcheck@master | ||
env: | ||
|
||
# We pin to a specific version of ShellCheck so that your build doesn't | ||
# break as newer versions with more warnings are released. | ||
# Maintainers: Keep an eye out for newer ShellCheck versions and consider | ||
# upgrading to them when they are released: | ||
# https://github.com/koalaman/shellcheck/tags | ||
version: v0.9.0 | ||
|
||
# Severity levels, in increasing order of strictness: | ||
# error | ||
# warning | ||
# info | ||
# style | ||
# We recommend `style` for maximum coverage, but adjust as you see fit. | ||
severity: style | ||
|
||
# Add any custom shellcheck CLI options here. | ||
# For example, use `-e SC2059` to ignore a certain warning. | ||
# (However, it's usually to ignore individual warnings inline: `# shellcheck: disable=SC2059`) | ||
SHELLCHECK_OPTS: | ||
|
||
# Ignore filepaths or filenames. | ||
# Each is a single string, space-separated. | ||
ignore_paths: | ||
ignore_names: | ||
|
||
# By default, your whole repo is scanned for shell scripts. | ||
# Uncomment the next line if you want to limit to a certain directory. | ||
#scandir: './scripts' | ||
|
||
# This ensures that all .sh files are passed to shellcheck in one go, making | ||
# ShellCheck aware of "include" logic (`source ./constants.sh`) between scripts. | ||
check_together: 'yes' | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
#!/usr/bin/env zsh | ||
# shellcheck disable=all | ||
# ^ This is zsh, which shellcheck doesn't support. | ||
git log --all ^opaque-keys-merge-base --format=%H $1 | while read f; do git branch --contains $f; done | sort -u |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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