mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-09-20 17:18:53 -04:00
Now that pull_request triggers fire for any base branch, limit runner minutes by skipping PR jobs unless the PR carries the 'run-ci' label. Applying a label needs triage access, so a fork PR can't enable the matrix by itself. The 'labeled' trigger type is added so applying the label starts a run immediately; skipped jobs cost no runner minutes. Push, schedule and manual dispatch runs are unaffected.
47 lines
1.6 KiB
YAML
47 lines
1.6 KiB
YAML
name: Lint GitHub Actions workflows
|
|
|
|
# Static-check the workflow YAML with rhysd/actionlint. Catches missing
|
|
# secrets, bad expressions, expression-type errors, unsupported runner
|
|
# images, and (via embedded shellcheck) common pitfalls in `run:` scripts.
|
|
# Trigger only on changes under .github/workflows/ so the rest of the
|
|
# matrix isn't billed when nothing here moves.
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
paths:
|
|
- '.github/workflows/*.yml'
|
|
- '.github/actionlint.yaml'
|
|
- '.github/actionlint.yml'
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, labeled]
|
|
paths:
|
|
- '.github/workflows/*.yml'
|
|
- '.github/actionlint.yaml'
|
|
- '.github/actionlint.yml'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
actionlint:
|
|
# temporary gate: PR CI runs only for PRs labeled 'run-ci', to save CI
|
|
# minutes; labels need triage access, so fork PRs can't self-enable.
|
|
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-ci')
|
|
runs-on: ubuntu-latest
|
|
name: actionlint
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: install actionlint
|
|
# Pin a version so this job is reproducible; bump deliberately.
|
|
# The download script verifies a SHA256 of the release tarball.
|
|
run: |
|
|
bash <(curl --proto '=https' --tlsv1.2 -fsSL \
|
|
https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) \
|
|
1.7.12
|
|
echo "$PWD" >>"$GITHUB_PATH"
|
|
- name: actionlint --version
|
|
run: actionlint -version
|
|
- name: actionlint .github/workflows/*.yml
|
|
run: actionlint -color
|