From e72b2acfc12939419285378b6ed45be7645788e6 Mon Sep 17 00:00:00 2001 From: RiskeyL <7a8y@163.com> Date: Thu, 28 May 2026 11:50:06 +0800 Subject: [PATCH] fix: correct backport PR template syntax and clear auto-assignee --- .backportrc.json | 3 ++- .github/workflows/backport-clear-assignee.yml | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/backport-clear-assignee.yml diff --git a/.backportrc.json b/.backportrc.json index 55f9a3215..00a9eaa10 100644 --- a/.backportrc.json +++ b/.backportrc.json @@ -2,7 +2,8 @@ "branchLabelMapping": { "^backport-to-(release/.+)$": "$1" }, - "prTitle": "{commitMessages} (backport to {targetBranch})", + "prTitle": "{{commitMessages}} (backport to {{targetBranch}})", + "prDescription": "# Backport\n\nThis will backport the following commits from `{{sourceBranch}}` to `{{targetBranch}}`:\n\n- {{commitMessages}}", "targetPRLabels": ["backport"], "autoMerge": false } diff --git a/.github/workflows/backport-clear-assignee.yml b/.github/workflows/backport-clear-assignee.yml new file mode 100644 index 000000000..b5ec85600 --- /dev/null +++ b/.github/workflows/backport-clear-assignee.yml @@ -0,0 +1,18 @@ +name: Clear assignee on backport PRs +on: + pull_request_target: + types: [assigned] +permissions: + pull-requests: write +jobs: + clear: + if: startsWith(github.event.pull_request.head.ref, 'backport/') + runs-on: depot-ubuntu-24.04 + steps: + - name: Remove the newly added assignee + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR: ${{ github.event.pull_request.number }} + USER: ${{ github.event.assignee.login }} + REPO: ${{ github.repository }} + run: gh pr edit "$PR" --repo "$REPO" --remove-assignee "$USER"