Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Lint

on:
# Allow manual runs of workflow from Actions tab
workflow_dispatch:

push:
paths-ignore: # ignore files that don't change build output
- '**/*.md'
- .github/dependabot.yml
- .gitignore
- LICENSE
pull_request:
paths-ignore: # ignore files that don't change build output
- '**/*.md'
- .github/dependabot.yml
- .gitignore
- LICENSE

permissions:
contents: read
actions: read

jobs:
shellcheck:
name: shellcheck
runs-on: 'ubuntu-24.04-arm'

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Install shellcheck
run: sudo apt-get update && sudo apt-get install -y shellcheck

# Every tracked shell script, plus any tracked executable with a shell
# shebang (the profile.d snippets and /usr/bin links are covered by the
# latter).
- name: Run shellcheck (warning severity)
run: |
{ git ls-files '*.sh'
git ls-files -s | awk '$1 == "100755" {print $4}' | xargs -r grep -l '^#!.*sh'
} | sort -u | xargs -r shellcheck -S warning

actionlint:
name: actionlint
runs-on: 'ubuntu-24.04-arm'

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Run actionlint
uses: raven-actions/actionlint@v2

slack-workflow-status:
if: ${{ always() && github.repository_owner == 'WLAN-Pi' && ! github.event.pull_request.head.repo.fork }}
name: Post Workflow Status to Slack
needs:
- shellcheck
- actionlint
runs-on: 'ubuntu-24.04'
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@master
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}