From fa5c2d74ae406c3ca6974dd616095b3a81c6a1b1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Sep 2026 15:11:18 +0000 Subject: [PATCH 1/8] Initial plan From 48c10dd1a3a8655ca8a8b880696931885b1e9fb1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Sep 2026 15:14:34 +0000 Subject: [PATCH 2/8] Report an error when the /backport command format is invalid Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com> --- .github/workflows/backport-base.yml | 41 ++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/.github/workflows/backport-base.yml b/.github/workflows/backport-base.yml index d0f5204d3e0..f72311f8875 100644 --- a/.github/workflows/backport-base.yml +++ b/.github/workflows/backport-base.yml @@ -45,7 +45,7 @@ jobs: repository_owners: ${{ inputs.repository_owners }} run_backport: - if: ${{ contains(format('{0},', inputs.repository_owners), format('{0},', github.repository_owner)) && github.event.issue.pull_request != '' && contains(github.event.comment.body, '/backport ') }} + if: ${{ contains(format('{0},', inputs.repository_owners), format('{0},', github.repository_owner)) && github.event.issue.pull_request != '' && contains(github.event.comment.body, '/backport') }} runs-on: ubuntu-latest permissions: contents: write @@ -60,15 +60,39 @@ jobs: script: | if (context.eventName !== "issue_comment") throw "Error: This action only works on issue_comment events."; + const comment_body = context.payload.comment.body || ''; + const comment_user = context.payload.comment.user.login; + + // find a line that starts with the /backport command; comments that only mention the + // command in the middle of a sentence are ignored + const command_regex = /^[ \t]*\/backport(?=[ \t]|$)(.*)$/m; + const command = command_regex.exec(comment_body); + if (command == null) { + console.log("No /backport command found at the beginning of a line, skipping."); + return ''; + } + // extract the target branch name from the trigger phrase containing these characters: a-z, A-Z, digits, forward slash, dot, hyphen, underscore - const regex = /^\s*\/backport (?:to )?((?!to(?:\s|$))[a-zA-Z\d\/\.\-\_]+)/m; - target_branch = regex.exec(context.payload.comment.body); - if (target_branch == null) throw "Error: No backport branch found in the trigger phrase."; + const command_arguments = command[1].trim().split(/\s+/).filter(argument => argument.length > 0); + if (command_arguments[0] === 'to') command_arguments.shift(); + const target_branch = command_arguments[0] || ''; + + if (!/^[a-zA-Z\d\/\.\-\_]+$/.test(target_branch)) { + const invalid_command_body = `@${comment_user} the \`/backport\` command was not recognized because it didn't specify a valid target branch. The expected format is \`/backport to \`, for example \`/backport to release/9.0\`.`; + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: invalid_command_body + }); + core.setFailed("Error: No backport branch found in the trigger phrase."); + return ''; + } - return target_branch[1]; + return target_branch; - name: Unlock comments if PR is locked uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ github.event.issue.locked == true }} + if: ${{ github.event.issue.locked == true && steps.target-branch-extractor.outputs.result != '' }} with: script: | console.log(`Unlocking locked PR #${context.issue.number}.`); @@ -79,6 +103,7 @@ jobs: }); - name: Post backport started comment to pull request uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + if: ${{ steps.target-branch-extractor.outputs.result != '' }} with: script: | const target_branch = '${{ steps.target-branch-extractor.outputs.result }}'; @@ -92,10 +117,12 @@ jobs: }); - name: Checkout repo uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + if: ${{ steps.target-branch-extractor.outputs.result != '' }} with: fetch-depth: 0 - name: Run backport uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + if: ${{ steps.target-branch-extractor.outputs.result != '' }} env: GH_TOKEN: ${{ github.token }} BACKPORT_PR_TITLE_TEMPLATE: ${{ inputs.pr_title_template }} @@ -383,7 +410,7 @@ jobs: - name: Re-lock PR comments uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ github.event.issue.locked == true && (success() || failure()) }} + if: ${{ github.event.issue.locked == true && steps.target-branch-extractor.outputs.result != '' && (success() || failure()) }} with: script: | console.log(`Locking previously locked PR #${context.issue.number} again.`); From 990bbdfb27cd64f730fd2234117781964c353245 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Sep 2026 15:47:59 +0000 Subject: [PATCH 3/8] Separate backport command parsing and feedback Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com> --- .github/workflows/backport-base.yml | 54 +++++++++++++++++++---------- 1 file changed, 35 insertions(+), 19 deletions(-) diff --git a/.github/workflows/backport-base.yml b/.github/workflows/backport-base.yml index f72311f8875..dba14c70986 100644 --- a/.github/workflows/backport-base.yml +++ b/.github/workflows/backport-base.yml @@ -61,7 +61,9 @@ jobs: if (context.eventName !== "issue_comment") throw "Error: This action only works on issue_comment events."; const comment_body = context.payload.comment.body || ''; - const comment_user = context.payload.comment.user.login; + core.setOutput('target_branch', ''); + core.setOutput('parsing_succeeded', 'false'); + core.setOutput('invalid_command', 'false'); // find a line that starts with the /backport command; comments that only mention the // command in the middle of a sentence are ignored @@ -74,25 +76,39 @@ jobs: // extract the target branch name from the trigger phrase containing these characters: a-z, A-Z, digits, forward slash, dot, hyphen, underscore const command_arguments = command[1].trim().split(/\s+/).filter(argument => argument.length > 0); - if (command_arguments[0] === 'to') command_arguments.shift(); - const target_branch = command_arguments[0] || ''; + const target_branch = command_arguments.length === 2 && command_arguments[0] === 'to' + ? command_arguments[1] + : ''; if (!/^[a-zA-Z\d\/\.\-\_]+$/.test(target_branch)) { - const invalid_command_body = `@${comment_user} the \`/backport\` command was not recognized because it didn't specify a valid target branch. The expected format is \`/backport to \`, for example \`/backport to release/9.0\`.`; - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: invalid_command_body - }); - core.setFailed("Error: No backport branch found in the trigger phrase."); + core.setOutput('invalid_command', 'true'); return ''; } - return target_branch; + core.setOutput('target_branch', target_branch); + core.setOutput('parsing_succeeded', 'true'); + - name: Report invalid backport command + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + if: ${{ steps.target-branch-extractor.outputs.invalid_command == 'true' && github.event.issue.locked != true }} + with: + script: | + const comment_user = context.payload.comment.user.login; + const invalid_command_body = `@${comment_user} the \`/backport\` command was not recognized because it didn't specify a valid target branch. The expected format is \`/backport to \`, for example \`/backport to release/9.0\`.`; + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: invalid_command_body + }); + - name: Fail invalid backport command + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + if: ${{ steps.target-branch-extractor.outputs.invalid_command == 'true' && (success() || failure()) }} + with: + script: | + core.setFailed("Error: No backport branch found in the trigger phrase."); - name: Unlock comments if PR is locked uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ github.event.issue.locked == true && steps.target-branch-extractor.outputs.result != '' }} + if: ${{ github.event.issue.locked == true && steps.target-branch-extractor.outputs.parsing_succeeded == 'true' }} with: script: | console.log(`Unlocking locked PR #${context.issue.number}.`); @@ -103,10 +119,10 @@ jobs: }); - name: Post backport started comment to pull request uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ steps.target-branch-extractor.outputs.result != '' }} + if: ${{ steps.target-branch-extractor.outputs.parsing_succeeded == 'true' }} with: script: | - const target_branch = '${{ steps.target-branch-extractor.outputs.result }}'; + const target_branch = '${{ steps.target-branch-extractor.outputs.target_branch }}'; const workflow_run_url = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; const backport_start_body = `Started backporting to \`${target_branch}\` ([link to workflow run](${workflow_run_url}))`; await github.rest.issues.createComment({ @@ -117,12 +133,12 @@ jobs: }); - name: Checkout repo uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - if: ${{ steps.target-branch-extractor.outputs.result != '' }} + if: ${{ steps.target-branch-extractor.outputs.parsing_succeeded == 'true' }} with: fetch-depth: 0 - name: Run backport uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ steps.target-branch-extractor.outputs.result != '' }} + if: ${{ steps.target-branch-extractor.outputs.parsing_succeeded == 'true' }} env: GH_TOKEN: ${{ github.token }} BACKPORT_PR_TITLE_TEMPLATE: ${{ inputs.pr_title_template }} @@ -132,7 +148,7 @@ jobs: CONFLICT_RESOLUTION_COMMAND: ${{ inputs.conflict_resolution_command }} with: script: | - const target_branch = '${{ steps.target-branch-extractor.outputs.result }}'; + const target_branch = '${{ steps.target-branch-extractor.outputs.target_branch }}'; const repo_owner = context.payload.repository.owner.login; const repo_name = context.payload.repository.name; const pr_number = context.payload.issue.number; @@ -410,7 +426,7 @@ jobs: - name: Re-lock PR comments uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ github.event.issue.locked == true && steps.target-branch-extractor.outputs.result != '' && (success() || failure()) }} + if: ${{ github.event.issue.locked == true && steps.target-branch-extractor.outputs.parsing_succeeded == 'true' && (success() || failure()) }} with: script: | console.log(`Locking previously locked PR #${context.issue.number} again.`); From 2a4a3787f33ed5b8551ada48162c30f33604631c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:00:35 +0000 Subject: [PATCH 4/8] Unlock PR before posting invalid-command comment, re-lock after Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com> --- .github/workflows/backport-base.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/backport-base.yml b/.github/workflows/backport-base.yml index dba14c70986..fda8bfddb17 100644 --- a/.github/workflows/backport-base.yml +++ b/.github/workflows/backport-base.yml @@ -87,9 +87,20 @@ jobs: core.setOutput('target_branch', target_branch); core.setOutput('parsing_succeeded', 'true'); + - name: Unlock comments if PR is locked + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + if: ${{ github.event.issue.locked == true && (steps.target-branch-extractor.outputs.parsing_succeeded == 'true' || steps.target-branch-extractor.outputs.invalid_command == 'true') }} + with: + script: | + console.log(`Unlocking locked PR #${context.issue.number}.`); + await github.rest.issues.unlock({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + }); - name: Report invalid backport command uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ steps.target-branch-extractor.outputs.invalid_command == 'true' && github.event.issue.locked != true }} + if: ${{ steps.target-branch-extractor.outputs.invalid_command == 'true' }} with: script: | const comment_user = context.payload.comment.user.login; @@ -106,17 +117,6 @@ jobs: with: script: | core.setFailed("Error: No backport branch found in the trigger phrase."); - - name: Unlock comments if PR is locked - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ github.event.issue.locked == true && steps.target-branch-extractor.outputs.parsing_succeeded == 'true' }} - with: - script: | - console.log(`Unlocking locked PR #${context.issue.number}.`); - await github.rest.issues.unlock({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - }); - name: Post backport started comment to pull request uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 if: ${{ steps.target-branch-extractor.outputs.parsing_succeeded == 'true' }} @@ -426,7 +426,7 @@ jobs: - name: Re-lock PR comments uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ github.event.issue.locked == true && steps.target-branch-extractor.outputs.parsing_succeeded == 'true' && (success() || failure()) }} + if: ${{ github.event.issue.locked == true && (steps.target-branch-extractor.outputs.parsing_succeeded == 'true' || steps.target-branch-extractor.outputs.invalid_command == 'true') && (success() || failure()) }} with: script: | console.log(`Locking previously locked PR #${context.issue.number} again.`); From 8ac2a38d5096af20696d82e80cf08515a7bbfec2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:08:39 +0000 Subject: [PATCH 5/8] Handle CRLF in /backport command regex Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com> --- .github/workflows/backport-base.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport-base.yml b/.github/workflows/backport-base.yml index fda8bfddb17..92683a81855 100644 --- a/.github/workflows/backport-base.yml +++ b/.github/workflows/backport-base.yml @@ -67,7 +67,7 @@ jobs: // find a line that starts with the /backport command; comments that only mention the // command in the middle of a sentence are ignored - const command_regex = /^[ \t]*\/backport(?=[ \t]|$)(.*)$/m; + const command_regex = /^[ \t]*\/backport(?=[ \t\r]|$)(.*)$/m; const command = command_regex.exec(comment_body); if (command == null) { console.log("No /backport command found at the beginning of a line, skipping."); From d8ee0fe19b10c934ccdf4679bb435ec09ad6769d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:08:40 +0000 Subject: [PATCH 6/8] Simplify backport workflow booleans Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com> --- .github/workflows/backport-base.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/backport-base.yml b/.github/workflows/backport-base.yml index 92683a81855..085f5c2916b 100644 --- a/.github/workflows/backport-base.yml +++ b/.github/workflows/backport-base.yml @@ -89,7 +89,7 @@ jobs: core.setOutput('parsing_succeeded', 'true'); - name: Unlock comments if PR is locked uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ github.event.issue.locked == true && (steps.target-branch-extractor.outputs.parsing_succeeded == 'true' || steps.target-branch-extractor.outputs.invalid_command == 'true') }} + if: ${{ github.event.issue.locked && (fromJSON(steps.target-branch-extractor.outputs.parsing_succeeded) || fromJSON(steps.target-branch-extractor.outputs.invalid_command)) }} with: script: | console.log(`Unlocking locked PR #${context.issue.number}.`); @@ -100,7 +100,7 @@ jobs: }); - name: Report invalid backport command uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ steps.target-branch-extractor.outputs.invalid_command == 'true' }} + if: ${{ fromJSON(steps.target-branch-extractor.outputs.invalid_command) }} with: script: | const comment_user = context.payload.comment.user.login; @@ -113,13 +113,13 @@ jobs: }); - name: Fail invalid backport command uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ steps.target-branch-extractor.outputs.invalid_command == 'true' && (success() || failure()) }} + if: ${{ fromJSON(steps.target-branch-extractor.outputs.invalid_command) && (success() || failure()) }} with: script: | core.setFailed("Error: No backport branch found in the trigger phrase."); - name: Post backport started comment to pull request uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ steps.target-branch-extractor.outputs.parsing_succeeded == 'true' }} + if: ${{ fromJSON(steps.target-branch-extractor.outputs.parsing_succeeded) }} with: script: | const target_branch = '${{ steps.target-branch-extractor.outputs.target_branch }}'; @@ -133,12 +133,12 @@ jobs: }); - name: Checkout repo uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - if: ${{ steps.target-branch-extractor.outputs.parsing_succeeded == 'true' }} + if: ${{ fromJSON(steps.target-branch-extractor.outputs.parsing_succeeded) }} with: fetch-depth: 0 - name: Run backport uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ steps.target-branch-extractor.outputs.parsing_succeeded == 'true' }} + if: ${{ fromJSON(steps.target-branch-extractor.outputs.parsing_succeeded) }} env: GH_TOKEN: ${{ github.token }} BACKPORT_PR_TITLE_TEMPLATE: ${{ inputs.pr_title_template }} @@ -426,7 +426,7 @@ jobs: - name: Re-lock PR comments uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 - if: ${{ github.event.issue.locked == true && (steps.target-branch-extractor.outputs.parsing_succeeded == 'true' || steps.target-branch-extractor.outputs.invalid_command == 'true') && (success() || failure()) }} + if: ${{ github.event.issue.locked && (fromJSON(steps.target-branch-extractor.outputs.parsing_succeeded) || fromJSON(steps.target-branch-extractor.outputs.invalid_command)) && (success() || failure()) }} with: script: | console.log(`Locking previously locked PR #${context.issue.number} again.`); From b3df4c20599c243898867e158020fffad5d17b64 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:34:26 +0000 Subject: [PATCH 7/8] Make invalid-command error messages specific to the parsing failure reason Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com> --- .github/workflows/backport-base.yml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/backport-base.yml b/.github/workflows/backport-base.yml index 085f5c2916b..a5b8cbd5962 100644 --- a/.github/workflows/backport-base.yml +++ b/.github/workflows/backport-base.yml @@ -64,6 +64,7 @@ jobs: core.setOutput('target_branch', ''); core.setOutput('parsing_succeeded', 'false'); core.setOutput('invalid_command', 'false'); + core.setOutput('invalid_reason', ''); // find a line that starts with the /backport command; comments that only mention the // command in the middle of a sentence are ignored @@ -74,18 +75,26 @@ jobs: return ''; } - // extract the target branch name from the trigger phrase containing these characters: a-z, A-Z, digits, forward slash, dot, hyphen, underscore + // the expected grammar is exactly: /backport to const command_arguments = command[1].trim().split(/\s+/).filter(argument => argument.length > 0); - const target_branch = command_arguments.length === 2 && command_arguments[0] === 'to' - ? command_arguments[1] - : ''; + let invalid_reason = ''; + if (command_arguments.length === 0) { + invalid_reason = 'no target branch was provided'; + } else if (command_arguments[0] !== 'to') { + invalid_reason = 'the "to" keyword is missing before the target branch'; + } else if (command_arguments.length !== 2) { + invalid_reason = 'more than one target branch was provided'; + } else if (!/^[a-zA-Z\d\/\.\-\_]+$/.test(command_arguments[1])) { + invalid_reason = 'the target branch contains characters that are not allowed (only letters, digits, "/", ".", "-", and "_" are permitted)'; + } - if (!/^[a-zA-Z\d\/\.\-\_]+$/.test(target_branch)) { + if (invalid_reason !== '') { core.setOutput('invalid_command', 'true'); + core.setOutput('invalid_reason', invalid_reason); return ''; } - core.setOutput('target_branch', target_branch); + core.setOutput('target_branch', command_arguments[1]); core.setOutput('parsing_succeeded', 'true'); - name: Unlock comments if PR is locked uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -101,10 +110,12 @@ jobs: - name: Report invalid backport command uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 if: ${{ fromJSON(steps.target-branch-extractor.outputs.invalid_command) }} + env: + INVALID_REASON: ${{ steps.target-branch-extractor.outputs.invalid_reason }} with: script: | const comment_user = context.payload.comment.user.login; - const invalid_command_body = `@${comment_user} the \`/backport\` command was not recognized because it didn't specify a valid target branch. The expected format is \`/backport to \`, for example \`/backport to release/9.0\`.`; + const invalid_command_body = `@${comment_user} the \`/backport\` command was not recognized because ${process.env.INVALID_REASON}. The expected format is \`/backport to \`, for example \`/backport to release/9.0\`.`; await github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, @@ -114,9 +125,11 @@ jobs: - name: Fail invalid backport command uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 if: ${{ fromJSON(steps.target-branch-extractor.outputs.invalid_command) && (success() || failure()) }} + env: + INVALID_REASON: ${{ steps.target-branch-extractor.outputs.invalid_reason }} with: script: | - core.setFailed("Error: No backport branch found in the trigger phrase."); + core.setFailed(`Error: the /backport command was not recognized because ${process.env.INVALID_REASON}. The expected format is "/backport to ".`); - name: Post backport started comment to pull request uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 if: ${{ fromJSON(steps.target-branch-extractor.outputs.parsing_succeeded) }} From c2a17715b69d1968c3f20134863fd25733e74f04 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Sep 2026 16:44:34 +0000 Subject: [PATCH 8/8] Report missing branch after backport to Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com> --- .github/workflows/backport-base.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backport-base.yml b/.github/workflows/backport-base.yml index a5b8cbd5962..24db6e2de2d 100644 --- a/.github/workflows/backport-base.yml +++ b/.github/workflows/backport-base.yml @@ -82,7 +82,9 @@ jobs: invalid_reason = 'no target branch was provided'; } else if (command_arguments[0] !== 'to') { invalid_reason = 'the "to" keyword is missing before the target branch'; - } else if (command_arguments.length !== 2) { + } else if (command_arguments.length === 1) { + invalid_reason = 'no target branch was provided after the "to" keyword'; + } else if (command_arguments.length > 2) { invalid_reason = 'more than one target branch was provided'; } else if (!/^[a-zA-Z\d\/\.\-\_]+$/.test(command_arguments[1])) { invalid_reason = 'the target branch contains characters that are not allowed (only letters, digits, "/", ".", "-", and "_" are permitted)';