Conversation
Set permissions: {} at workflow level in publish-image.yml and move
permissions down to each individual job: build gets contents/packages,
manifest gets contents/packages/id-token for cosign keyless signing.
- Add persist-credentials: false to all checkout steps (artipacked)
- Add permissions: {} workflow-level and contents: read per-job in ci.yml (excessive-permissions)
- Add cooldown: default-days: 10 to both dependabot ecosystems (dependabot-cooldown)
There was a problem hiding this comment.
Pull request overview
This PR hardens the repository’s GitHub automation by tightening GitHub Actions security (pinning action refs, reducing default permissions, and adding workflow lint/audit jobs) and by adjusting Dependabot update behavior.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Pin GitHub Actions to commit SHAs and reduce default workflow permissions to
permissions: {}with per-job grants. - Update the image publish workflow to reduce injection risk by avoiding direct
${{ ... }}interpolation inside shell scripts. - Add a CI job to run
actionlintandzizmor, and expand Dependabot config (grouping + cooldown).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/publish-image.yml |
Pins actions, reduces default permissions, and hardens shell steps used in image publishing/signing. |
.github/workflows/ci.yml |
Pins actions, reduces default permissions, and adds an actions audit job (actionlint + zizmor). |
.github/dependabot.yml |
Adds grouping for GitHub Actions updates and introduces cooldown configuration. |
Comments suppressed due to low confidence (1)
.github/workflows/publish-image.yml:57
buildruns onpull_request, but the GHCR login step runs unconditionally. Since the image isn’t pushed on PRs (push: false), this login is unnecessary and can fail on fork PRs due to restricted token permissions. Consider gating the login step (and any other registry-auth-dependent steps) withif: github.event_name != 'pull_request'so PR builds don’t attempt to authenticate to GHCR.
- name: Log in to GHCR
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -28,6 +24,9 @@ jobs: | |||
| name: Build and push image (${{ matrix.arch }}) | |||
| runs-on: ${{ matrix.runner }} | |||
| timeout-minutes: 45 | |||
There was a problem hiding this comment.
The build job requests packages: write, but on pull_request runs it never pushes images (and can be configured to skip registry login). This is broader than necessary for PR builds, and undermines the least-privilege goal of the PR. To fully minimize privileges, consider splitting PR builds vs. publish builds into separate jobs/workflows so only the publish path gets packages: write.
| timeout-minutes: 45 | |
| timeout-minutes: 45 | |
| if: github.event_name != 'pull_request' |
There was a problem hiding this comment.
The build job needs packages: write because it pushes images on non-PR events (tag pushes). The workflow uses a single job definition for both paths. Splitting by event trigger would add complexity without meaningful security benefit since the token is scoped to this repo's packages.
Replaces the generic default-days cooldown with semver-granular values so low-risk patches flow faster while major bumps get more soak time. Also corrects github-actions cooldown from 10 days to 7 days.
8bd56eb to
7a56e02
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cooldown: | ||
| semver-major-days: 7 | ||
| semver-minor-days: 3 | ||
| semver-patch-days: 2 | ||
| default-days: 7 |
There was a problem hiding this comment.
PR description says a 10-day Dependabot cooldown, but this bundler entry sets shorter values (e.g., default/major 7 days, minor 3, patch 2). Please align the configuration with the stated 10-day cooldown (or update the PR description if 7/3/2 is intended).
Summary
permissions: {}at workflow levelTest plan
zizmor .