Add concurrency control and least-privilege permissions to PR check workflow
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.7k
- Forks
- 2.8k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 489
Description
Summary
The pr-check.yml workflow is missing a concurrency group and explicit permissions,
unlike its sibling precommit-check.yml which already has both.
Proposed Changes
- Add
concurrencygroup — cancel in-progress runs when a new push arrives on the
same PR, preventing wasted CI runner minutes on stale runs. - Add explicit
permissionsblock — declare least-privilegereadaccess for
pull-requestsandcontents, following GitHub's security hardening recommendations. - Bump Python from 3.10 to 3.12 — consistent with
precommit-check.ymland uses
a more current runtime.
Motivation
- Rapid successive pushes to a PR currently trigger multiple redundant workflow runs.
- Without explicit permissions, the workflow inherits the repository-wide default, which
is broader than necessary. - Python version inconsistency across workflows in the same directory.
All three patterns already exist in precommit-check.yml, so this aligns pr-check.yml
with established conventions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing pr-check.yml with its sibling precommit-check.yml, focusing on the existing concurrency, permissions, and Python setup patterns. Update pr-check.yml to match the three requested conventions, then run or inspect the PR check workflow configuration to confirm the concurrency group, read-only permissions, and Python 3.12 setting are present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, python
- Domain
- ci-cd, security
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100