diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 99ebe3b43d0cf8..22dc0656dabecc 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -22,7 +22,7 @@ jobs: if (context.eventName !== "issue_comment") throw "Error: This action only works on issue_comment events."; // extract the target branch name from the trigger phrase containing these characters: a-z, A-Z, digits, forward slash, dot, hyphen, underscore - const regex = /\/backport to ([a-zA-Z\d\/\.\-\_]+)/; + const regex = /^\/backport to ([a-zA-Z\d\/\.\-\_]+)/; target_branch = regex.exec(context.payload.comment.body); if (target_branch == null) throw "Error: No backport branch found in the trigger phrase."; diff --git a/eng/actions/backport/index.js b/eng/actions/backport/index.js index 49a2c740108813..3cc1a57312ac92 100644 --- a/eng/actions/backport/index.js +++ b/eng/actions/backport/index.js @@ -39,7 +39,7 @@ async function run() { console.log(`Verified ${comment_user} is a repo collaborator.`); } catch (error) { console.log(error); - throw new BackportException(`Error: @${comment_user} is not a repo collaborator, backporting is not allowed.`); + throw new BackportException(`Error: @${comment_user} is not a repo collaborator, backporting is not allowed. If you're a collaborator please make sure your Microsoft team membership visibility is set to Public on https://github.com/orgs/microsoft/people?query=${comment_user}`); } try { await exec.exec(`git ls-remote --exit-code --heads origin ${target_branch}`) } catch { throw new BackportException(`Error: The specified backport target branch ${target_branch} wasn't found in the repo.`); }