Skip to content

chore(ci): publish to GCP via Workload Identity Federation instead of an SA key - #458

Merged
jcalero merged 2 commits into
masterfrom
publish-wif-auth
Oct 29, 2026
Merged

jcalero merged 2 commits into
masterfrom
publish-wif-auth

Conversation

@jcalero

@jcalero jcalero commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

The publish workflow authenticates to GCP with a long-lived service-account key held in a repository secret. This switches it to short-lived OIDC tokens via Workload Identity Federation, so there is no static credential left to manage or rotate.

  • No stored GCP credential. google-github-actions/auth@v2 exchanges the job's GitHub OIDC token for a short-lived GCP token.
  • Publishing runs in the release environment. The job now targets the release environment, which only v* tags can deploy to. A tag ruleset limits creating, moving or deleting v* tags to admins and maintainers.
  • gsutil → gcloud storage. gcloud uses the federated credential directly. The existence check before each upload behaves as before.

The GCP and environment configuration is already in place, so merging this has no effect until the next release.

Test plan

  • Cut the next release (as an admin or maintainer).
  • GCP Auth succeeds on both matrix legs, and the binaries and .deb appear under gs://reinfer-public/cli/.
  • After a green run, remove the old key-based secret.

🤖 Generated with Claude Code

gsutil is in maintenance mode and does not reliably pick up the
external-account credentials that Workload Identity Federation produces.
gcloud storage uses the gcloud credential directly. The existence check
keeps the same semantics: any non-zero exit (missing or forbidden) falls
through to the upload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jcalero
jcalero marked this pull request as ready for review October 29, 2026 11:10
Replace the long-lived service-account key with GitHub OIDC tokens. The
publish job now runs in the `release` environment, which only release
tags can deploy to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@anachili anachili left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with a clarifying question

Comment on lines +17 to +18
# Only v* tags may deploy to this environment, and only admins and
# maintainers may create those tags. GCP trusts OIDC tokens from this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm the "Release tags" ruleset has the admin role (or specific people) in its bypass list? With write access I can't see the list, and rulesets apply to admins too unless they're listed. If it's empty, nobody can create a v* tag and the next release will fail at tagging. Also, the repo has no one with the maintain role, so in practice this means admins only.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jcalero
jcalero merged commit f38b3f3 into master Oct 29, 2026
4 of 5 checks passed

This branch had an error being deployed

1 failed deployment
release — 562d93ce Deployed Oct 29, 2026 by jcalero via publish (ubuntu-24.04) #161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants