Skip to content

Commit

Permalink
Add command to manually refresh Heroku status in PRs (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcretu committed Jun 14, 2024
1 parent f0561f6 commit 5f59ee2
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/heroku.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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:
Expand Down

0 comments on commit 5f59ee2

Please sign in to comment.