6767 fi
6868
6969 PR_DATA=$(gh api "/repos/${{ github.repository }}/pulls/${PR_NUMBER}")
70- HEAD_REF=$(echo "$PR_DATA" | jq -r .head.ref)
7170 HEAD_SHA=$(echo "$PR_DATA" | jq -r .head.sha)
7271 BASE_REF=$(echo "$PR_DATA" | jq -r .base.ref)
7372 URL=$(echo "$PR_DATA" | jq -r .html_url)
8887 {
8988 echo "should_sync=${SHOULD_SYNC}"
9089 echo "pr_number=${PR_NUMBER}"
91- echo "head_ref=${HEAD_REF}"
90+ # The branch pushed into cloud-compilation with BOT_PAT. Never reuse the PR's own head ref:
91+ # a fork author picks that name (it could be "main" or "develop").
92+ echo "head_ref=flink-sql-runner/pr-${PR_NUMBER}"
9293 echo "head_sha=${HEAD_SHA}"
9394 echo "base_ref=${BASE_REF}"
9495 echo "url=${URL}"
@@ -128,7 +129,7 @@ jobs:
128129 statuses : write
129130 steps :
130131 - name : Post passing status for cloud-compilation/build
131- uses : actions/github-script@v9
132+ uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
132133 with :
133134 script : |
134135 await github.rest.repos.createCommitStatus({
@@ -153,7 +154,7 @@ jobs:
153154 statuses : write
154155 steps :
155156 - name : Post pending status for cloud-compilation/build
156- uses : actions/github-script@v9
157+ uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
157158 with :
158159 script : |
159160 await github.rest.repos.createCommitStatus({
@@ -166,13 +167,13 @@ jobs:
166167 });
167168
168169 - name : Checkout flink-sql-runner repo
169- uses : actions/checkout@v7
170+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
170171 with :
171172 ref : ${{ needs.decide.outputs.pr_head_sha }}
172173 path : flink-sql-runner
173174
174175 - name : Checkout cloud-compilation repo
175- uses : actions/checkout@v7
176+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
176177 with :
177178 repository : DataSQRL/cloud-compilation
178179 token : ${{ secrets.BOT_PAT }}
@@ -371,7 +372,7 @@ jobs:
371372
372373 - name : Post failure status for cloud-compilation/build
373374 if : failure()
374- uses : actions/github-script@v9
375+ uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
375376 with :
376377 script : |
377378 await github.rest.repos.createCommitStatus({
@@ -417,7 +418,7 @@ jobs:
417418 id : branch_exists
418419 env :
419420 GH_TOKEN : ${{ secrets.BOT_PAT }}
420- BRANCH_NAME : ${{ github.event.pull_request.head.ref }}
421+ BRANCH_NAME : flink-sql-runner/pr- ${{ github.event.pull_request.number }}
421422 run : |
422423 if gh api "/repos/DataSQRL/cloud-compilation/branches/${BRANCH_NAME}" >/dev/null 2>&1; then
423424 echo "exists=true" >> "$GITHUB_OUTPUT"
@@ -428,7 +429,7 @@ jobs:
428429
429430 - name : Checkout cloud-compilation repo
430431 if : steps.branch_exists.outputs.exists == 'true'
431- uses : actions/checkout@v7
432+ uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
432433 with :
433434 repository : DataSQRL/cloud-compilation
434435 token : ${{ secrets.BOT_PAT }}
@@ -467,7 +468,7 @@ jobs:
467468 if : steps.branch_exists.outputs.exists == 'true'
468469 id : revert
469470 env :
470- BRANCH_NAME : ${{ github.event.pull_request.head.ref }}
471+ BRANCH_NAME : flink-sql-runner/pr- ${{ github.event.pull_request.number }}
471472 BASE_REF : ${{ github.event.pull_request.base.ref }}
472473 PR_NUMBER : ${{ github.event.pull_request.number }}
473474 run : |
@@ -495,7 +496,7 @@ jobs:
495496 if : steps.branch_exists.outputs.exists == 'true'
496497 env :
497498 GH_TOKEN : ${{ secrets.BOT_PAT }}
498- BRANCH_NAME : ${{ github.event.pull_request.head.ref }}
499+ BRANCH_NAME : flink-sql-runner/pr- ${{ github.event.pull_request.number }}
499500 BASE_REF : ${{ github.event.pull_request.base.ref }}
500501 PR_NUMBER : ${{ github.event.pull_request.number }}
501502 run : |
@@ -525,7 +526,7 @@ jobs:
525526 if : steps.branch_exists.outputs.exists == 'true'
526527 env :
527528 GH_TOKEN : ${{ secrets.BOT_PAT }}
528- BRANCH_NAME : ${{ github.event.pull_request.head.ref }}
529+ BRANCH_NAME : flink-sql-runner/pr- ${{ github.event.pull_request.number }}
529530 PR_NUMBER : ${{ github.event.pull_request.number }}
530531 run : |
531532 CC_PR_URL=$(gh pr list \
@@ -553,7 +554,7 @@ jobs:
553554 - name : Comment on cloud-compilation PR (if exists)
554555 env :
555556 GH_TOKEN : ${{ secrets.BOT_PAT }}
556- BRANCH_NAME : ${{ github.event.pull_request.head.ref }}
557+ BRANCH_NAME : flink-sql-runner/pr- ${{ github.event.pull_request.number }}
557558 PR_NUMBER : ${{ github.event.pull_request.number }}
558559 run : |
559560 CC_PR=$(gh pr list \
0 commit comments