ci(release): use a PAT so the Version Packages PR triggers CI#29
Open
yan-vidal wants to merge 1 commit into
Open
ci(release): use a PAT so the Version Packages PR triggers CI#29yan-vidal wants to merge 1 commit into
yan-vidal wants to merge 1 commit into
Conversation
PRs opened by the default GITHUB_TOKEN never trigger workflows, so with main's required checks + enforce_admins the changesets release PR was unmergeable without a manual close/reopen. Pass secrets.CHANGESETS_PAT (falling back to GITHUB_TOKEN until the secret exists) to checkout and the changesets action. Publishing still uses OIDC; the token only authors the PR, branch pushes, tags and releases.
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.
Problema
PRs abertos pela própria GitHub Action (com o
GITHUB_TOKENpadrão) não disparam workflows (proteção anti-loop do GitHub). Como amainagora exige os checksChangeset+verifycomenforce_admins: true, o PR automático "Version Packages" do Changesets fica sem checks → impossível de mesclar, travando releases (precisava de umclose/reopenmanual).Mudança
Passa
secrets.CHANGESETS_PAT(com fallback paraGITHUB_TOKEN) tanto noactions/checkoutquanto no env dachangesets/action. Com o PAT de um usuário real, o PR de release é atribuído a esse usuário e dispara o CI sozinho.GITHUB_TOKEN(comportamento atual — release PR exige reopen manual). Assim que o secret for criado, passa a funcionar automaticamente, sem mais mudanças.pnpm releasecontinua usando OIDC (id-token); o token só autora o PR, os pushes da branchchangeset-release/main, as tags e os releases.changeset-release/main(branch não protegida); o commit de versão entra namainvia merge da PR, então o PAT não contorna a proteção damain.Sem changeset
Só altera
.github/workflows/release.yml— nenhum pacote publicável muda, então o gateChangesetpassa sem changeset (verificado:changeset statusexit 0).