Skip to content

Commit

Permalink
ci: only satisfy pre-checks once merge requested (#8275)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mhofman and mergify[bot] authored Aug 29, 2023
1 parent d56e0f7 commit 89a3a85
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/mergify-ready.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:

wait-integration-pre-checks:
needs: pre_check
if: needs.pre_check.outputs.merge_requested == 'true'
runs-on: ubuntu-latest
steps:
- name: wait
Expand All @@ -28,7 +29,7 @@ jobs:
cat <<EOF
needs ${{ toJSON(needs.pre_check.outputs) }}
EOF
sleep 5
sleep 15
merge-strategy:
runs-on: ubuntu-latest
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/pre-check-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ on:
should_run:
description: "'true' if the test should run"
value: "${{ jobs.check_and_cancel.outcome != 'skipped' && jobs.check_and_cancel.outputs.should_skip != 'true' }}"
merge_requested:
description: "'true' if pull_request was requested for merge"
value: >-
${{
github.event_name != 'pull_request' || (
(
github.event.pull_request.base.ref == 'master' ||
github.event.pull_request.base.ref == 'release-pismo' ||
github.event.pull_request.base.ref == 'beta'
) &&
github.event.pull_request.draft == false &&
(
contains(github.event.pull_request.labels.*.name, 'automerge:squash') ||
contains(github.event.pull_request.labels.*.name, 'automerge:no-update') ||
contains(github.event.pull_request.labels.*.name, 'automerge:rebase') ||
github.event.pull_request.auto_merge != null
)
)
}}
jobs:
check_and_cancel:
Expand Down

0 comments on commit 89a3a85

Please sign in to comment.