Skip to content

Commit

Permalink
Mark All jobs as failed on PR closed events
Browse files Browse the repository at this point in the history
This job is used for branch requirements, and
we don't want it to show as skipped in case the PR
is ever reopened.

See: #1143

Change-type: minor
Signed-off-by: Kyle Harding <[email protected]>
  • Loading branch information
klutchell committed Jul 31, 2024
1 parent 303b60d commit cbf6b29
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/flowzone.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion flowzone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4265,11 +4265,26 @@ jobs:
- cargo_publish
- custom_publish
- custom_always
# Run on event triggers for open PRs
# OR when the PR is closed but not merged
# See https://github.com/product-os/flowzone/issues/1143
if: |
always() &&
github.event.pull_request.state == 'open'
(
github.event.pull_request.state == 'open' ||
(
github.event.pull_request.state == 'closed' && github.event.pull_request.merged != true
)
)
steps:
# Avoid showing this job as skipped if a PR is reopened
# See https://github.com/product-os/flowzone/issues/1143
- name: Reject on closed pull requests
if: github.event.pull_request.state == 'closed' && github.event.pull_request.merged != true
run: |
echo "::warning::Marking this job as failed so if the PR is reopened it does not satisfy merge requirements"
exit 1
- *rejectFailedJobs
- *rejectCancelledJobs

Expand Down

0 comments on commit cbf6b29

Please sign in to comment.