Skip to content

Commit

Permalink
Merge pull request #781 from hashicorp/global-status-for-mergify
Browse files Browse the repository at this point in the history
chore(tests): Provide global PR workflow status
  • Loading branch information
ansgarm authored Jun 15, 2021
2 parents b27fe04 + 28772b4 commit 203c56a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/timechart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: wait
id: waitforstatuschecks
uses: "WyriHaximus/github-action-wait-for-status@v1.2"
with:
ignoreActions: checkrun-timechart
Expand All @@ -20,4 +21,16 @@ jobs:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
SHA: "${{ github.event.pull_request.head.sha }}"
TRACE_START: "${{ github.event.pull_request.updated_at }}"
TRACE_START: "${{ github.event.pull_request.updated_at }}"

# It's difficult to determine all jobs for a PR
# see https://docs.mergify.io/conditions/#about-status-checks
# Since we have this 'checkrun-timechart' job, which essentially
# knows all the statuses (see https://github.com/WyriHaximus/github-action-wait-for-status#output),
# we can leverage it to provide a global status to mergify.
- name: 'mergify status'
uses: actions/github-script@v3
if: steps.waitforstatuschecks.outputs.status != 'success'
with:
script: |
core.setFailed('One of the Github Actions workflows failed for this PR')

0 comments on commit 203c56a

Please sign in to comment.