Repository navigation
ci: pin actions, least-privilege token, fix ruff install, pytest >=9.0.3 - #1
Merged
Merged
Conversation
- Pin actions/checkout to the v4.4.0 commit SHA in both workflows and stop persisting the token in the checkout. - Add a top-level read-only permissions block to ci.yml. - Quote the ruff requirement and pin it to 0.17.3. The unquoted 'ruff>=0.15.0' was parsed by bash as a redirect, so the version spec was never applied and pip output went to a file named '=0.15.0'. - Raise the pytest floor to 9.0.3 (GHSA-6w46-j5rx-g56g, vulnerable tmpdir handling) in tests/, backend/ and ghostbill-python/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016g7tG1VzB5Xnr8GJ7rGDti
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Supply-chain hardening for CI after the October 2026 GitHub Actions credential-theft campaigns (GhostAction), plus one real CI bug and a pytest advisory.
1. Pin actions to a commit SHA.
actions/checkout@v4is nowactions/checkout@11d5960a…(v4.4.0) inci.yml(2×) andissue_create_auto_reply.yml. The major version is unchanged, so behaviour is unchanged. The SHA was verified against thev4andv4.4.0tags ofactions/checkout, and it is the pin already used across the othergexiro-globalrepos. A mutable tag can be repointed to malicious code; a SHA cannot. Each checkout also setspersist-credentials: false, since no job pushes.2. Least-privilege token.
ci.ymlhad nopermissions:block, so it inherited the repository default token scope. It now declarescontents: read.issue_create_auto_reply.ymlalready restricted itself toissues: writeand is unchanged apart from the pin.3. Fix the ruff install (real bug).
run: pip install ruff>=0.15.0is unquoted, so bash parses>=0.15.0as a stdout redirect. The version constraint was never applied, and pip's output went to a file called=0.15.0. Reproduced:It is now
pip install "ruff==0.17.3"(exact pin).ruff checkandruff format --checkwith 0.17.3 pass locally onbackend/app/(all checks passed, 67 files already formatted).4. pytest floor 8.0.0 → 9.0.3 (GHSA-6w46-j5rx-g56g, vulnerable tmpdir handling, fixed in 9.0.3). Applied in
tests/requirements.txt,backend/pyproject.tomlandghostbill-python/pyproject.toml. pytest 9.0.3 requires Python ≥3.10, which all three projects already need.Not changed here (follow-up)
pytestandpytest-asyncioare listed inbackend/pyproject.toml[project].dependencies, andbackend/Dockerfilerunspip install ., so the test framework ships in the production image. Moving them to an optionaltestextra changes how CI installs them indocker-compose.test.yml, so it belongs in its own PR.Verification
ruff==0.17.3lint and format checks pass onbackend/app/.Generated by Claude Code