33 lines
939 B
YAML
33 lines
939 B
YAML
---
|
|
name: Shellcheck
|
|
run-name: |
|
|
Shellcheck: ${{
|
|
github.event_name == 'pull_request' && format('PR #{0} by @{1} - {2}', github.event.pull_request.number, github.actor, github.event.pull_request.title) ||
|
|
github.event_name == 'push' && github.event.head_commit && format('Push by @{0} - {1}', github.actor, github.event.head_commit.message) ||
|
|
format('{0} triggered by @{1}', github.event_name, github.actor)
|
|
}}
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
shellcheck:
|
|
name: Check shell scripts
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt update && sudo apt install -y shellcheck
|
|
- name: shellcheck
|
|
run: |
|
|
git grep -l '^#\( *shellcheck \|!\(/bin/\|/usr/bin/env \)\(sh\|bash\|dash\|ksh\)\)' | xargs shellcheck
|