From 4e008609e2e8f674d647ae16158a8d5d3807ad67 Mon Sep 17 00:00:00 2001 From: sebas_correa Date: Fri, 7 Aug 2026 13:24:02 -0300 Subject: [PATCH] fix(ci): compare release PR author against REST-style bot login MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The find-pr job introduced in #479 used `gh pr list --json author`, whose --json output is GraphQL-backed and represents github-actions[bot] as "app/github-actions" — not "github-actions[bot]" like the REST API's user.login (what the old pull_request-triggered version, and the reusable workflow's release_pr_author default, compare against). Confirmed live: the first real workflow_run after #479 merged found PR #476 but skipped it with "Open PR doesn't match expected author/label", leaving it unmerged. Switch the lookup to `gh api .../pulls` (REST) so user.login matches github-actions[bot] as expected. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/auto-merge-release.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto-merge-release.yml b/.github/workflows/auto-merge-release.yml index 181a0607e..a55e909a0 100644 --- a/.github/workflows/auto-merge-release.yml +++ b/.github/workflows/auto-merge-release.yml @@ -28,16 +28,23 @@ jobs: # release PR ourselves and validate its author/label — this is exactly # what the reusable workflow's `pr_number` input expects the caller to # do for non-pull_request triggers. + # + # Uses the REST API (`gh api .../pulls`) rather than `gh pr list + # --json author`: gh's --json output is GraphQL-backed and represents + # this bot as "app/github-actions", not "github-actions[bot]" like the + # REST `user.login` (and like github.event.pull_request.user.login, + # which the old pull_request-triggered version of this workflow — and + # the reusable workflow's release_pr_author default — compare against). - name: Find open release-please PR id: find env: GH_TOKEN: ${{ github.token }} + REPO_OWNER: ${{ github.repository_owner }} run: | - PR_JSON=$(gh pr list \ - --repo ${{ github.repository }} \ - --head release-please--branches--main \ - --state open \ - --json number,author,labels \ + PR_JSON=$(gh api "repos/${{ github.repository }}/pulls" \ + -X GET \ + -f state=open \ + -f "head=${REPO_OWNER}:release-please--branches--main" \ --jq '.[0] // empty') if [ -z "$PR_JSON" ]; then @@ -46,7 +53,7 @@ jobs: exit 0 fi - AUTHOR=$(echo "$PR_JSON" | jq -r '.author.login') + AUTHOR=$(echo "$PR_JSON" | jq -r '.user.login') HAS_LABEL=$(echo "$PR_JSON" | jq '[.labels[].name] | contains(["autorelease: pending"])') if [ "$AUTHOR" != "github-actions[bot]" ] || [ "$HAS_LABEL" != "true" ]; then