From ab420f9b7dad83b10487c21bc27eb60cbdaea887 Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Sun, 23 Aug 2026 21:27:59 -0300 Subject: [PATCH] =?UTF-8?q?ops(fix):=20passa=20GITHUB=5FTOKEN=20aos=20work?= =?UTF-8?q?flows=20de=20flip=20na=20main-merge=20(GH=5FTOKEN=20n=C3=A3o=20?= =?UTF-8?q?era=20lido=20pelos=20scripts)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit github-api.mjs lê GITHUB_TOKEN (não GH_TOKEN); os dois workflows de flip pós-merge (issue-done e plan-issue-ready) só definiam GH_TOKEN, então o script falhava em autenticar ('Sem token ... defina GITHUB_TOKEN') e o flip/promoção silenciava: o job saía success mas a Issue ficava presa (PR #818 / #817 e PR #820 / #813). Alinha com agent-pr-ready-automerge.yml que já passava GITHUB_TOKEN explicitamente. --- .github/workflows/issue-done-on-main-merge.yml | 8 ++++++-- .github/workflows/plan-issue-ready-on-main-merge.yml | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/issue-done-on-main-merge.yml b/.github/workflows/issue-done-on-main-merge.yml index c75d86a9..9bd24481 100644 --- a/.github/workflows/issue-done-on-main-merge.yml +++ b/.github/workflows/issue-done-on-main-merge.yml @@ -36,8 +36,12 @@ jobs: (github.event_name == 'workflow_dispatch' && inputs.pr != '') runs-on: ubuntu-latest env: - # The github-api.mjs client reads GITHUB_TOKEN; the built-in token has - # `issues: write` scoped to this repo (the issue tracker is on GitHub). + # The github-api.mjs client reads GITHUB_TOKEN (not GH_TOKEN); the built-in + # token has `issues: write` scoped to this repo (the issue tracker is on + # GitHub). Explicit `github.token` — the built-in GITHUB_TOKEN env is not + # guaranteed on every event path; passing it via the documented context is + # the robust form (same as agent-pr-ready-automerge.yml). + GITHUB_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/plan-issue-ready-on-main-merge.yml b/.github/workflows/plan-issue-ready-on-main-merge.yml index c6b1ec6b..3f9d5d2f 100644 --- a/.github/workflows/plan-issue-ready-on-main-merge.yml +++ b/.github/workflows/plan-issue-ready-on-main-merge.yml @@ -43,8 +43,12 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 env: - # The github-api.mjs client reads GITHUB_TOKEN; the built-in token has - # `issues: write` scoped to this repo (the tracker is on GitHub). + # The github-api.mjs client reads GITHUB_TOKEN (not GH_TOKEN); the built-in + # token has `issues: write` scoped to this repo (the tracker is on GitHub). + # Explicit `github.token` — the built-in GITHUB_TOKEN env is not guaranteed + # on every event path; passing it via the documented context is the robust form + # (same as agent-pr-ready-automerge.yml). + GITHUB_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v5