Files
scst/.github/workflows/checkpatch_pull.yml
T
wenlxieandGleb Chesnokov 35bde5f339 .github/workflows: Fail the checkpatch download on HTTP errors
The checkpatch workflows fetch checkpatch.pl, spelling.txt and
const_structs.checkpatch with a plain curl. When raw.githubusercontent.com
rate-limits the runner, curl saves the HTTP 429 error page as
checkpatch.pl and exits successfully. The next step then runs that page
as a script, so every commit fails with

  ./checkpatch.pl: line 1: 429:: command not found

which looks like a checkpatch failure of the pull request.

Pass -f so that an HTTP error fails the download step, and --retry 5 so
that transient errors, including HTTP 429, are retried first. Also use
-sSL to keep the log quiet and follow redirects.
2026-10-17 08:03:39 +03:00

32 lines
1.1 KiB
YAML

name: Checkpatch upon pull request
on:
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
checkpatch:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
with:
ref: ${{github.event.pull_request.head.sha}}
fetch-depth: 0
- name: Download checkpatch.pl
run: |
curl -fsSL --retry 5 https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl -o checkpatch.pl
curl -fsSL --retry 5 https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt -o spelling.txt
curl -fsSL --retry 5 https://raw.githubusercontent.com/torvalds/linux/master/scripts/const_structs.checkpatch -o const_structs.checkpatch
chmod +x checkpatch.pl
- name: Run checkpatch.pl
run: |
CHECKPATCH_PATH=. ./scripts/checkpatch_commits ${{github.event.pull_request.base.sha}}