Files
systemd/.github/workflows/differential-shellcheck.yml
Paul Meyer 659d194912 ci: skip push-triggered jobs on forks
Syncing a fork's main branch triggers the push workflows if actions are
enabled, which then run the full CI matrix and use up the fork owner's
Actions minutes for no benefit. Only skip push events so that PRs within
a fork still run CI, which is useful for testing actions.

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
(cherry picked from commit 4c63532c28094aeba6dccc5afb9690e02fd98d66)
2026-10-16 17:24:52 +01:00

44 lines
1.3 KiB
YAML

# SPDX-License-Identifier: LGPL-2.1-or-later
# https://github.com/redhat-plumbers-in-action/differential-shellcheck#readme
name: Differential ShellCheck
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
lint:
if: >
github.event.repository.name != 'systemd-security' &&
(github.event_name != 'push' || github.repository == 'systemd/systemd')
runs-on: ubuntu-24.04
permissions:
security-events: write
steps:
- name: Repository checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 0
persist-credentials: false
- name: Differential ShellCheck
uses: redhat-plumbers-in-action/differential-shellcheck@f51c7c0d32777d00de777131d25918617a246415
with:
# exclude all `.in` files because they may contain unsupported syntax, and they have to be preprocessed first
# TEMPORARY: exclude bash completion files, they would generate too many defects in Code scanning dashboard (600+)
# exclude zsh completion files, zsh is not supported by ShellCheck
exclude-path: |
'**/*.in'
'shell-completion/bash/*'
'shell-completion/zsh/*'
token: ${{ secrets.GITHUB_TOKEN }}