Skip to content

Instantly share code, notes, and snippets.

@sephraim
Created August 21, 2024 20:39
Show Gist options
  • Save sephraim/5075fb1446c77e55d80b1dc7386ce138 to your computer and use it in GitHub Desktop.
Save sephraim/5075fb1446c77e55d80b1dc7386ce138 to your computer and use it in GitHub Desktop.
[GitHub Actions - Lint shell scripts with Differential Shellcheck]
# FILE: .github/workflows/lint-shell-scripts.yml
# SOURCE: https://github.com/koalaman/shellcheck/wiki/GitHub-Actions
name: Lint shell scripts
on:
push:
branches:
- main
- master
- develop
paths:
- 'bin/**'
- '.githooks/**'
pull_request:
branches:
- main
- master
- develop
paths:
- 'bin/**'
- '.githooks/**'
permissions:
contents: read
jobs:
Lint:
runs-on: ubuntu-latest
permissions:
# required for all workflows
security-events: write
# only required for workflows in private repositories
actions: read
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Differential ShellCheck requires full git history
fetch-depth: 0
- name: Run linting
uses: redhat-plumbers-in-action/differential-shellcheck@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment