Skip to content

Commit

Permalink
.github: Add differential-shellcheck workflow for shell script analysis
Browse files Browse the repository at this point in the history
Introduce a new GitHub workflow to run shellcheck on changed shell
scripts. This workflow automatically detect and highlight potential
shell script issues in pull requests. This change is a follow-up to
commit 0700b32 which fixed an undefined variable issue in `install.sh`.
It intends to leverage static analysis to improve script quality and
catch potential errors early.

Shellcheck will now:
- Analyze all shell scripts modified in pull requests
- Provide inline comments with specific issue details
- Help prevent similar variable-related mistakes in the future

See also
https://github.com/redhat-plumbers-in-action/differential-shellcheck

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Dec 3, 2024
1 parent 3d67bb1 commit 322556e
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/differential-shellcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
# https://github.com/redhat-plumbers-in-action/differential-shellcheck#readme

name: Differential ShellCheck
on:
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest

permissions:
security-events: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Differential ShellCheck
uses: redhat-plumbers-in-action/differential-shellcheck@v5
with:
severity: warning
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 322556e

Please sign in to comment.