File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 uses : actions/checkout@v4
2323 with :
2424 fetch-depth : 0
25- ref : ${{ startsWith(github.event.pull_request.head.ref, 'dependabot/') && github.event.pull_request.head.ref || github.ref }}
2625 repository : ${{ github.event.pull_request.head.repo.full_name }}
2726
2827 - name : Install Python 3.11
@@ -43,13 +42,21 @@ jobs:
4342 run : make lint
4443
4544 - name : Commit and push changes
45+ env :
46+ PR_HEAD_REF : ${{ github.event.pull_request.head.ref }}
4647 run : |
4748 git config user.name "github-actions[bot]"
4849 git config user.email "github-actions[bot]@users.noreply.github.com"
50+
51+ if [ -z "$PR_HEAD_REF" ] || ! echo "$PR_HEAD_REF" | grep -Eq '^dependabot/'; then
52+ echo "PR head ref '$PR_HEAD_REF' is not a allowed Dependabot branch; skipping push."
53+ exit 1
54+ fi
55+
4956 if git status --porcelain | grep .; then
5057 git add -A
5158 git commit -m "mesh-2092: apply make update changes"
52- git push
59+ git push origin HEAD:"$PR_HEAD_REF"
5360 else
5461 echo "No changes to commit"
5562 fi
You can’t perform that action at this time.
0 commit comments