Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions .github/workflows/pr-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ on:
# matching the sibling required-check workflows; jobs skip and the result skip-passes.
merge_group:

# Ensures that only one workflow task will run at a time. Previous builds, if
# already in process, will get cancelled. Only the latest commit will be allowed
# to run, cancelling any workflows in between
# Cancel obsolete gate runs after new commits. Unrelated label events use a
# separate group so they cannot cancel the required PR Gate run.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
group: >-
${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{
(github.event.action == 'labeled' || github.event.action == 'unlabeled') &&
github.event.label.name != 'A-release' &&
'ignored-label' ||
'required'
}}
cancel-in-progress: true

permissions:
Expand All @@ -29,6 +34,10 @@ env:

jobs:
changes:
# Only the A-release label affects gate results; other label events are no-ops.
if: >-
(github.event.action != 'labeled' && github.event.action != 'unlabeled') ||
github.event.label.name == 'A-release'
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
Expand Down Expand Up @@ -158,6 +167,8 @@ jobs:
name: Release readiness
if: >-
github.event_name == 'pull_request' &&
((github.event.action != 'labeled' && github.event.action != 'unlabeled') ||
github.event.label.name == 'A-release') &&
startsWith(github.event.pull_request.head.ref, 'release-plz-') &&
contains(github.event.pull_request.labels.*.name, 'A-release')
runs-on: ubuntu-latest-xl
Expand Down Expand Up @@ -253,8 +264,19 @@ jobs:
fi

pr-gate-result:
# Keep skipped unrelated-label runs from replacing the required check.
name: >-
${{
(github.event.action == 'labeled' || github.event.action == 'unlabeled') &&
github.event.label.name != 'A-release' &&
'Label does not affect the PR gate' ||
'pr-gate-result'
}}
runs-on: ubuntu-latest
if: always()
if: >-
always() &&
((github.event.action != 'labeled' && github.event.action != 'unlabeled') ||
github.event.label.name == 'A-release')
needs: [changes, semver-checks, changelog-gate, release-readiness]
timeout-minutes: 5
steps:
Expand Down