Skip to content

Commit

Permalink
fix(ci): post failed status to PR and isolate branch checkout on comm…
Browse files Browse the repository at this point in the history
…ent trigger (#17544)
  • Loading branch information
neuronull authored May 30, 2023
1 parent 3b87e00 commit e2c0255
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ jobs:

- uses: actions/checkout@v3

- name: Checkout PR branch (issue_comment)
if: github.event_name == 'issue_comment'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr checkout ${{ github.event.issue.number }}

# If triggered by issue comment, the event payload doesn't directly contain the head and base sha from the PR.
# But, we can retrieve this info from some commands.
- name: Get PR metadata (issue_comment)
Expand All @@ -140,8 +146,6 @@ jobs:
export PR_NUMBER=${{ github.event.issue.number }}
echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_OUTPUT
gh pr checkout ${PR_NUMBER}
export BASELINE_SHA=$(git merge-base --fork-point master)
echo "BASELINE_SHA=${BASELINE_SHA}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -768,7 +772,7 @@ jobs:
if: github.event_name == 'issue_comment' && env.FAILED == 'true'
uses: myrotvorets/set-commit-status-action@v1.1.7
with:
sha: ${{ steps.compute-metadata.outputs.comparison-sha }}
sha: ${{ steps.comment-branch.outputs.head_sha }}
token: ${{ secrets.GITHUB_TOKEN }}
context: Regression Detection Suite
status: 'failure'
Expand Down

0 comments on commit e2c0255

Please sign in to comment.