Skip to content

chore(deploy): fetch INFRA_PR_TOKEN from Vault via vault-pull-secrets - #101

Merged
BK1031 merged 1 commit into
mainfrom
bk1031/vault-pull-secrets
Jul 11, 2026
Merged

chore(deploy): fetch INFRA_PR_TOKEN from Vault via vault-pull-secrets#101
BK1031 merged 1 commit into
mainfrom
bk1031/vault-pull-secrets

Conversation

@BK1031

@BK1031 BK1031 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #100. Matches the pattern in Gaucho-Racing/Vault's deploy workflow: fetch the infra PR token from Vault at runtime using GitHub OIDC via `Gaucho-Racing/vault-pull-secrets@v1`, instead of a long-lived `INFRA_PR_TOKEN` repo secret.

Changes

  • Add `id-token: write` permission to the job (required for GitHub OIDC).
  • Add a `Pull secrets` step that fetches `infrastructure.pr_token` from Vault into `steps.vault.outputs.secrets_json`.
  • Replace the two references to `${{ secrets.INFRA_PR_TOKEN }}` (checkout of infrastructure, and `GH_TOKEN` for `gh pr create`) with `${{ fromJSON(steps.vault.outputs.secrets_json).PR_TOKEN }}`.

Prereq

The Vault-side kubernetes/OIDC rule that already permits the vault repo's deploy workflow to fetch this secret must also cover the sentinel repo. If it's scoped to a specific repo/actor, extend to include Gaucho-Racing/Sentinel. If it's a wildcard, no change needed.

If the workflow fails on the `Pull secrets` step after merge, that's the fix — grant sentinel's actor access to the `infrastructure.pr_token` selector in Vault.

After merge

  • The repo-level `INFRA_PR_TOKEN` secret can be deleted (no other workflow references it), but no rush — deleting it doesn't affect anything as long as the Vault fetch works.

Match the pattern in the Gaucho-Racing/Vault deploy workflow: use
Gaucho-Racing/vault-pull-secrets@v1 with GitHub OIDC to fetch the infra
PR token at runtime from the `infrastructure.pr_token` app-secret in
Vault, instead of storing it as a long-lived repo secret.

Advantages:
- One less place a token has to live (single source of truth in Vault)
- Rotate the token via Vault UI without touching every consuming repo
- Ephemeral: token only exists in the workflow's runtime process, not
  in GitHub's secret store

The workflow's `id-token: write` permission is what lets vault-pull-secrets
exchange the GitHub OIDC token for a Vault-issued auth. The Vault-side
kubernetes/OIDC rule that already permits this pattern from the vault
repo's deploy workflow needs to also permit the sentinel repo — if not
already covered by a wildcard rule, the sentinel workflow will fail on
the vault fetch step until a rule is added.
@BK1031
BK1031 merged commit 61fc337 into main Jul 11, 2026
18 checks passed
@BK1031
BK1031 deleted the bk1031/vault-pull-secrets branch July 11, 2026 05:17
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.

1 participant