Skip to content

Commit

Permalink
Only try to comment on failure
Browse files Browse the repository at this point in the history
b/290997541
  • Loading branch information
oxve committed Jul 21, 2023
1 parent a06537e commit c68554a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/unit_test_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,15 @@ jobs:
$dir/**/*.xml
done
- name: Comment on PR on Failure
# TODO: Change to failure once tested.
if: success()
if: failure()
uses: actions/github-script@v6
with:
script: |
if (context.payload.workflow_run.pull_requests.length == 0) {
// Nothing to comment on. The job was not triggered from a pull request.
return;
}
// Get url of this workflow run.
const actions_run = (await github.rest.actions.getWorkflowRun({
owner : context.repo.owner,
Expand Down

0 comments on commit c68554a

Please sign in to comment.