From 5f59ee25c96bdcccfd4aebb31963834bfaec8dd0 Mon Sep 17 00:00:00 2001 From: Paul Cretu Date: Fri, 14 Jun 2024 00:31:09 -0700 Subject: [PATCH] Add command to manually refresh Heroku status in PRs (#503) --- .github/workflows/heroku.yaml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/heroku.yaml b/.github/workflows/heroku.yaml index 9059ec14..54a8b5df 100644 --- a/.github/workflows/heroku.yaml +++ b/.github/workflows/heroku.yaml @@ -1,15 +1,20 @@ -name: Heroku # Based on https://janjones.me/posts/github-action-heroku-deployment/ +name: Heroku -on: deployment_status +on: + deployment_status: + issue_comment: + types: [created, edited] jobs: deployment-status: name: Check deployment status runs-on: ubuntu-latest - # Continue only if some definitive status has been reported. - if: github.event.deployment_status.state != 'pending' + # Continue only if some definitive status has been reported. Also allow + # manual refresh of status checks by commenting '/refresh-heroku-status'. + if: ${{ github.event.deployment_status.state != 'pending' + || (contains(github.event.comment.body, '/refresh-heroku-status') && github.event.issue.pull_request) }} steps: # Forward deployment's status to the deployed commit. @@ -29,8 +34,10 @@ jobs: name: Check site health runs-on: ubuntu-latest - # Run health check only if deployment succeeds. - if: github.event.deployment_status.state == 'success' + # Run health check only if deployment succeeds. Also allow manual refresh + # of status checks by commenting '/refresh-heroku-status'. + if: ${{ github.event.deployment_status.state == 'success' + || (contains(github.event.comment.body, '/refresh-heroku-status') && github.event.issue.pull_request) }} # Check that the deployed app returns successful HTTP response. steps: