From 9c48a47c570221c4f861ef43945537fcc62c21cf Mon Sep 17 00:00:00 2001 From: selmankoc Date: Tue, 6 Oct 2026 11:06:57 +0300 Subject: [PATCH] fix(ci): approve auto-merge-forward PRs with a different actor BOT_SECRET opens the PR, so the same token cannot approve it and auto-merge never starts. Co-authored-by: Cursor --- .github/workflows/auto-merge-forward.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-merge-forward.yml b/.github/workflows/auto-merge-forward.yml index 1b29bac67a..bfa2a7015c 100644 --- a/.github/workflows/auto-merge-forward.yml +++ b/.github/workflows/auto-merge-forward.yml @@ -189,14 +189,17 @@ jobs: "cc ${MENTIONS[*]}")" gh pr comment "$FORWARD_BRANCH" --body "$COMMENT" - # BOT_SECRET, not github.token: a merge performed with the default token produces a push - # that triggers no workflow, which would stop the chain at the first hop. + # Approve with github.token: BOT_SECRET opened the PR, and GitHub rejects a review + # from the author ("Can not approve your own pull request"). The merge stays on + # BOT_SECRET: a merge performed with the default token produces a push that + # triggers no workflow, which would stop the chain at the first hop. - name: Approve and auto-merge if: steps.target.outputs.skip != 'true' && steps.merge.outputs.conflict != 'true' env: GH_TOKEN: ${{ secrets.BOT_SECRET }} + APPROVE_TOKEN: ${{ github.token }} run: | set -euo pipefail FORWARD_BRANCH="${{ steps.merge.outputs.branch }}" - gh pr review "$FORWARD_BRANCH" --approve + GH_TOKEN="$APPROVE_TOKEN" gh pr review "$FORWARD_BRANCH" --approve gh pr merge "$FORWARD_BRANCH" --merge --auto --delete-branch