Skip to content

Commit e2c0255

Browse files
authored
fix(ci): post failed status to PR and isolate branch checkout on comment trigger (#17544)
1 parent 3b87e00 commit e2c0255

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/regression.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ jobs:
129129

130130
- uses: actions/checkout@v3
131131

132+
- name: Checkout PR branch (issue_comment)
133+
if: github.event_name == 'issue_comment'
134+
env:
135+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136+
run: gh pr checkout ${{ github.event.issue.number }}
137+
132138
# If triggered by issue comment, the event payload doesn't directly contain the head and base sha from the PR.
133139
# But, we can retrieve this info from some commands.
134140
- name: Get PR metadata (issue_comment)
@@ -140,8 +146,6 @@ jobs:
140146
export PR_NUMBER=${{ github.event.issue.number }}
141147
echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_OUTPUT
142148
143-
gh pr checkout ${PR_NUMBER}
144-
145149
export BASELINE_SHA=$(git merge-base --fork-point master)
146150
echo "BASELINE_SHA=${BASELINE_SHA}" >> $GITHUB_OUTPUT
147151
@@ -768,7 +772,7 @@ jobs:
768772
if: github.event_name == 'issue_comment' && env.FAILED == 'true'
769773
uses: myrotvorets/[email protected]
770774
with:
771-
sha: ${{ steps.compute-metadata.outputs.comparison-sha }}
775+
sha: ${{ steps.comment-branch.outputs.head_sha }}
772776
token: ${{ secrets.GITHUB_TOKEN }}
773777
context: Regression Detection Suite
774778
status: 'failure'

0 commit comments

Comments
 (0)