ci(release): trigger release.yml via GitHub App token - #87
Open
SoulKyu wants to merge 1 commit into
Open
Conversation
release-please pushed the release tag with the default GITHUB_TOKEN. GitHub does not start new workflow runs from GITHUB_TOKEN-triggered events (anti-recursion), so release.yml (on: push: tags) never fired and the Docker image was never built/pushed. Mint a GitHub App token and use it for release-please so the tag push is a distinct identity that triggers release.yml. release.yml is unchanged: the tag trigger and the cosign keyless identity (refs/tags/v*) are preserved. Requires repo/org secrets RELEASE_APP_ID and RELEASE_APP_PRIVATE_KEY from a GitHub App with Contents:write + Pull requests:write.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problème
Après merge d'une PR release-please, le tag
vX.Y.Z+ la GitHub Release sont créés, mais le workflowRelease(build/push image Docker, cosign, trivy, retag stable, charts) ne se déclenche jamais. L'image n'est donc jamais publiée (constaté surv3.2.4).Cause racine
release-please.ymlpoussait le tag avecsecrets.GITHUB_TOKEN. GitHub bloque volontairement la cascade : un event produit par leGITHUB_TOKENpar défaut ne crée pas de nouveau run (anti-récursion). Donc lepushdu tag n'armait pas le triggeron: push: tagsderelease.yml. L'équipe contournait jusqu'ici viaworkflow_dispatchmanuel.Fix
Minter un GitHub App token (
actions/create-github-app-token@v1) et le passer à release-please-action à la place deGITHUB_TOKEN. Un token d'App est une identité distincte → le push du tag déclencherelease.ymlnormalement.release.ymlinchangé : triggeron: push: tagset identité cosign keyless (refs/tags/v*) préservés.regen-helm-docsreste surGITHUB_TOKEN(push sur branche de PR, pas de cascade tag requise).Créer/réutiliser une GitHub App (perms repo
Contents: write+Pull requests: write), l'installer sur le repo, et ajouter 2 secrets :RELEASE_APP_IDRELEASE_APP_PRIVATE_KEYSans ces secrets, le step
app-tokenéchouera.Vérification post-merge
main) → vérifier qu'un runReleasedémarre automatiquement :gh run list --workflow=release.yml.docker pull ghcr.io/numberly/vault-db-injector:<vX.Y.Z>+ tag:latest.cosign verifyavec l'identitérelease.yml@refs/tags/v*doit passer.