2024-12-26 18:00:33 +00:00
|
|
|
name: Shellcheck
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: "5 1 * * *"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
shellcheck:
|
|
|
|
name: Shellcheck
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
2025-01-01 12:13:19 +00:00
|
|
|
- name: Get changed files
|
|
|
|
id: changes
|
|
|
|
run: |
|
2025-01-01 17:26:23 +00:00
|
|
|
if ${{ github.event_name == 'pull_request' }}; then
|
|
|
|
echo "files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
|
|
|
|
else
|
|
|
|
echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
|
|
|
|
fi
|
2025-01-01 12:13:19 +00:00
|
|
|
|
2024-12-26 18:00:33 +00:00
|
|
|
- name: Run ShellCheck
|
2025-01-01 12:13:19 +00:00
|
|
|
if: steps.changes.outputs.files != ''
|
|
|
|
run: |
|
|
|
|
echo "${{ steps.changes.outputs.files }}" | xargs shellcheck
|