From 4433480e45454a4dac78c26204b7b4acaf62adb3 Mon Sep 17 00:00:00 2001 From: andig Date: Sat, 1 Aug 2026 12:54:27 +0200 Subject: [PATCH] chore: distinguish backport pull requests by title and label (#32381) --- .github/workflows/claude-issue-agent.yml | 8 ++++++-- .github/workflows/command-backport.yml | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/claude-issue-agent.yml b/.github/workflows/claude-issue-agent.yml index 9d2821119..1aaf10b82 100644 --- a/.github/workflows/claude-issue-agent.yml +++ b/.github/workflows/claude-issue-agent.yml @@ -30,8 +30,12 @@ jobs: pr-label: name: PR labeling # bot PRs (dependabot etc.) are skipped: the action rejects non-human actors - # unless allowlisted, and bots already label their own PRs - if: github.event_name == 'pull_request_target' && github.event.pull_request.user.type != 'Bot' + # unless allowlisted, and bots already label their own PRs. backports are + # skipped as well, they carry the backport label and nothing else + if: | + github.event_name == 'pull_request_target' && + github.event.pull_request.user.type != 'Bot' && + !startsWith(github.event.pull_request.head.ref, 'backport/') runs-on: ubuntu-latest permissions: contents: read # read base repo for area classification diff --git a/.github/workflows/command-backport.yml b/.github/workflows/command-backport.yml index cdcdb443b..21e8ad7dc 100644 --- a/.github/workflows/command-backport.yml +++ b/.github/workflows/command-backport.yml @@ -158,11 +158,15 @@ jobs: NUMBER: ${{ github.event.issue.number }} ACTOR: ${{ github.event.comment.user.login }} run: | + # the release line the branch was cut from, 0.313 for release/0.313.1 + line=$(echo "${TARGET#release/}" | cut -d. -f1,2) + # the pull request is authored by the deploy token, so name the requester url=$(gh pr create \ --base "$TARGET" \ --head "$BRANCH" \ - --title "$TITLE" \ + --title "$line backport: $TITLE" \ + --label backport \ --assignee "$ACTOR" \ --body "Backport of #$NUMBER to \`$TARGET\`, requested by @$ACTOR.") echo "url=$url" >> "$GITHUB_OUTPUT"