Skip to content

Commit

Permalink
Add workflow for validating runner scripts with shellcheck
Browse files Browse the repository at this point in the history
I am about to revisit #1517, #1454, #1561, and #1560 as a part of our on-going effort to a major enhancement to the runner entrypoints being made in #1759.

This change is a counterpart of #1852. #1852 enables you to easily run shellcheck locally. This enables you to automatically run shellcheck on every pull request.

Currently, any shellcheck error does not result in failing the workflow job. Once we addressed all the shellcheck findings, we can flip the fail_on_error option to true and let jobs start failing on pull requests that introduces invalid or suspicious bash code.
  • Loading branch information
mumoshu committed Sep 25, 2022
1 parent f3fcb42 commit 52e75fd
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/validate-runner-scripts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Validate Runner Scripts
on:
pull_request:
types:
- opened
- synchronize
- reopened
paths:
- 'runner/**.sh'
- 'runner/**.bash'
jobs:
shellcheck:
name: runner / shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: shellcheck
uses: reviewdog/action-shellcheck@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: shellcheck
path: "./runner"
pattern: |
*.sh
*.bash
exclude: "./.git/*"
check_all_files_with_shebangs: "false"
# Set this to "true" once we addressed all the shellcheck findings
fail_on_error: "false"

0 comments on commit 52e75fd

Please sign in to comment.