File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ permissions:
1212jobs :
1313 backport :
1414 permissions :
15- contents : write # for Git to git push
15+ contents : write # for git push to PR branch
1616 runs-on : ubuntu-latest
1717 steps :
1818 - run : |
4848
4949 git checkout -b $branch
5050 git cherry-pick $commit
51+
52+ if git diff --name-only HEAD~1 HEAD | grep -q '^\.github/workflows/'; then
53+ echo "::error::This PR contains changes to workflow files (.github/workflows/)."
54+ echo "::error::Workflow files cannot be automatically backported because the standard"
55+ echo "::error::GitHub token doesn't have the required 'workflow' write permission."
56+ echo "::error::Please backport this PR manually."
57+ exit 1
58+ fi
59+
5160 git push --set-upstream origin $branch
5261 gh pr create --title "[$GITHUB_REF_NAME] $title" \
5362 --body "Clean cherry-pick of #$NUMBER to the \`$GITHUB_REF_NAME\` branch." \
You can’t perform that action at this time.
0 commit comments