Repository navigation
ci: turn off persist-credentials where no job pushes and add actions.lock - #8999
Totara-thib wants to merge 2 commits into
Conversation
actions/checkout keeps the job token in the git configuration until the job ends, so every later step of the job can use it through git. build-images.yml already opts out on its four checkouts. This does the same for the other jobs that only read the repository: the test shards, the compatibility suites, the drift and docs checks, the Helm chart jobs, the nightly and release image builds, the standalone binaries and the Maven cache pruning job. None of these jobs pushes or fetches with git after the checkout. What is left is local: rev-parse, log and diff in the workflows, and the merge-base and diff that ct lint runs on history fetch-depth: 0 already brought in. Two checkouts keep the token on purpose. docs.yml needs it for mkdocs gh-deploy, which pushes the gh-pages branch, and release-cut.yml for semantic-release, which pushes the release commit and the tag. Signed-off-by: Thibaud Van den Berghe <thibaud@getplumber.io>
Every action is already pinned by commit and Dependabot moves the pins. What the workflow files cannot show is what those actions call in turn: chart-testing-action runs astral-sh/setup-uv and attest-build-provenance runs actions/attest. actions.lock is GitHub's workflow dependency lockfile, generated with gh actions-lock. It records the commit behind each of the 23 actions and those two, with the numeric ids of their repositories, so a later change in what an action calls shows up in a diff and a repository replaced behind a name is refused at run time. Generated with --no-narrow, so no pin in a workflow file changes. The one edit to the workflows is the path of the zstd image action in release.yml, nightly.yml and push-zstd-image.yml, from ./ to $/. The tool does not follow a ./ action, and without an entry for the docker/build-push-action it calls those jobs would fail once the lockfile applies. $/ is the same action, taken at the commit of the running workflow. The lockfile does not cover calls to reusable workflows, so pr-limit.yml is unchanged. Signed-off-by: Thibaud Van den Berghe <thibaud@getplumber.io>
|
🎉 Thanks for your first pull request to Floci! Your CI checks need a maintainer to approve them before they run. That is GitHub's standard gate on first-time contributors, not a problem with your PR — so if the checks look like they are doing nothing, that is why. Once a maintainer approves, CI and the compatibility suite start automatically. Nothing is needed from you in the meantime. While you wait, a couple of things that make review faster:
Come join us in Slack — it is the fastest way to reach maintainers if you get stuck, or want feedback on an approach before investing more time in it. |
PR Summary by QodoHarden CI checkouts and lock workflow action dependencies
AI Description
Merge Risk
|
Code Review by Qodo
1. Manual nightly builds can mix branch code
|
|
|
||
| - name: Build and push native nightly image | ||
| uses: ./.github/actions/push-zstd-image | ||
| uses: $/.github/actions/push-zstd-image |
There was a problem hiding this comment.
1. Manual nightly builds can mix branch code 🐞 Bug ≡ Correctness
The new $/ reference in push-native loads the image action from the running workflow's commit, while that job still checks out main. When a maintainer dispatches the nightly workflow from another branch, its branch-specific action and recompression script operate on the main worktree before pushing the nightly tags.
Agent Prompt
## Issue description
A manual nightly run from a non-main branch now executes that branch's image action against a checkout of main, potentially changing the code used to publish nightly images.
## Fix Focus Areas
- .github/workflows/nightly.yml[17-18]
- .github/workflows/nightly.yml[28-32]
- .github/workflows/nightly.yml[233-236]
## Recommended Fix
Gate the `prepare` job to `refs/heads/main` so its dependent build and publishing jobs cannot run when the workflow is manually dispatched from another branch. Keep the `$/` references for main runs.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
The automated review flagged that a manual nightly from another branch now takes that branch's image action while checking out main. That run already uses the branch's nightly.yml, so the action now matches the workflow calling it. Scheduled runs are unchanged. If nightly should only publish from main, an if: github.ref == 'refs/heads/main' on prepare covers it, happy to add it.
|
@Totara-thib thanks for taking the time, and welcome! We're going to close this one, though. Workflow lockfiles are a GitHub Enterprise Cloud feature this org isn't on, and every action here is already pinned to a full commit SHA, so If you'd like to work on Floci, opening an issue first is the best way in, so the scope is agreed before any code. |
Summary
Hello some CI hardening contribution:
build-images.ymlalready checks out withpersist-credentials: false. This does the same for the 34 other checkouts that keep the job token in jobs that never push. A job likepush-nativeinrelease.ymlandnightly.ymlholds the Docker Hub token and the AWS role: after tj-actions (CVE-2025-30066), the less it carries on disk the better.docs.yml(mkdocs gh-deploy) andrelease-cut.yml(semantic-release).actions.lock, GitHub's workflow dependency lockfile, fromgh actions-lock --no-narrow: your commit pins stay, it records what those actions call in turn (setup-uv,actions/attest), and Dependabot regenerates it with each update../action, so the zstd image action becomes$/in three workflows (same action, at the workflow's commit). Say so and I drop that commit.No test added, only workflow files change. Release, nightly and docs workflows do not run here.
Found and fixed with Plumber (C 64/100 before, up to A 90/100 after), reviewed and submitted by me.
Type of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
No change: CI workflows only.
Checklist
./mvnw testpasses locally