Skip to content

ci: declare contents:write on Release workflow's release job#2139

Merged
nacx merged 2 commits into
envoyproxy:mainfrom
arpitjain099:chore/release-permissions
Jun 2, 2026
Merged

ci: declare contents:write on Release workflow's release job#2139
nacx merged 2 commits into
envoyproxy:mainfrom
arpitjain099:chore/release-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown
Contributor

@arpitjain099 arpitjain099 commented May 14, 2026

Description

The Release workflow runs on tag push and has two jobs:

  • docker_push -- calls the reusable ./.github/workflows/docker_build_job.yaml workflow
  • release -- runs gh release create (twice, branched on -rc suffix) to attach helm tarballs + the aigw binaries to the GitHub release

The gh release create API call needs contents: write. Right now there's no permissions: block on either the workflow or the release job, so the token gets whatever the repo default grants.

This patch adds permissions: contents: write at the release job (not at workflow scope) for two reasons:

  1. docker_push is a reusable-workflow caller. Per GitHub docs on reusable workflows [1], a caller-level permissions: block intersects with the callee's grants. Keeping the new block on the release job leaves the callee's existing permissions story unchanged.
  2. The docker_push callee already authenticates to DockerHub via DOCKERHUB_PASSWORD and DOCKERHUB_USERNAME (external secrets), so it doesn't need the workflow GITHUB_TOKEN for the push path.

Style matches the per-job permission blocks already used by codeql.yaml (actions: read, contents: read, security-events: write) and the workflow-level block in build_and_test.yaml (contents: read, packages: write, id-token: write).

No behavioural change. The release workflow continues to use ${{ secrets.GITHUB_TOKEN }} for the two gh release create calls, just with the scope spelled out.

1: https://docs.github.com/en/actions/using-workflows/reusing-workflows#access-and-permissions

The release job runs `gh release create` with the implicit GITHUB_TOKEN
to attach helm chart tarballs and the aigw binaries as release assets.
The releases/upload-asset API needs contents:write.

The block sits on the `release` job rather than at workflow scope to
avoid intersecting with the docker_push reusable workflow caller
(`./.github/workflows/docker_build_job.yaml`), which has its own
permissions story for the DockerHub push path.

Style matches the per-job permissions blocks already used by codeql.yaml
(actions:read, contents:read, security-events:write) and the
workflow-level block in build_and_test.yaml (contents:read + packages:write +
id-token:write).

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 requested a review from a team as a code owner May 14, 2026 02:37
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 14, 2026
Comment thread .github/workflows/release.yaml Outdated
Signed-off-by: Ignasi Barrera <nacx@apache.org>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.33%. Comparing base (1d1e81a) to head (ba2f2f4).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2139      +/-   ##
==========================================
- Coverage   84.40%   84.33%   -0.08%     
==========================================
  Files         134      134              
  Lines       19059    19352     +293     
==========================================
+ Hits        16087    16320     +233     
- Misses       1991     2033      +42     
- Partials      981      999      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nacx nacx merged commit 95b98bc into envoyproxy:main Jun 2, 2026
33 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants