Skip to content

Commit 34947df

Browse files
committed
ci: skip the ci workflow on the release PR
1 parent f8e5c6b commit 34947df

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ on:
99
permissions:
1010
contents: read
1111

12+
# Every job is guarded with `if: github.head_ref != 'changeset-release/main'` so
13+
# that none of them run on the release PR, which only bumps versions and writes
14+
# changelogs; release-dry-run.yml installs, builds and packs that tree already.
15+
1216
jobs:
1317
build:
1418
runs-on: ${{ matrix.os }}
1519
name: Java ${{ matrix.java }} ${{ matrix.os }}
20+
if: github.head_ref != 'changeset-release/main'
1621
strategy:
1722
matrix:
1823
java: [17]
@@ -41,6 +46,7 @@ jobs:
4146
protocol-tests:
4247
runs-on: ${{ matrix.os }}
4348
name: Protocol Tests
49+
if: github.head_ref != 'changeset-release/main'
4450
strategy:
4551
matrix:
4652
java: [17]
@@ -78,6 +84,7 @@ jobs:
7884
lint-typescript:
7985
runs-on: ubuntu-latest
8086
name: TypeScript Lint
87+
if: github.head_ref != 'changeset-release/main'
8188
steps:
8289
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
8390
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
@@ -93,6 +100,7 @@ jobs:
93100
runs-on: smithy-typescript_ubuntu-latest_8-core
94101
name: TypeScript Test ${{ matrix.node }}
95102
needs: ["ensure-typescript-packages-have-changesets", "lint-typescript", "ensure-typescript-formatted"]
103+
if: github.head_ref != 'changeset-release/main'
96104
strategy:
97105
fail-fast: false
98106
matrix:
@@ -129,6 +137,7 @@ jobs:
129137
extract-docs:
130138
runs-on: smithy-typescript_ubuntu-latest_8-core
131139
name: Extract Docs
140+
if: github.head_ref != 'changeset-release/main'
132141
steps:
133142
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
134143
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
@@ -147,6 +156,7 @@ jobs:
147156
ensure-typescript-formatted:
148157
runs-on: ubuntu-latest
149158
name: Ensure TypeScript is formatted
159+
if: github.head_ref != 'changeset-release/main'
150160
steps:
151161
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
152162
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
@@ -167,6 +177,7 @@ jobs:
167177
ensure-typescript-packages-have-changesets:
168178
runs-on: ubuntu-latest
169179
name: Ensure TypeScript packages have changesets
180+
if: github.head_ref != 'changeset-release/main'
170181
steps:
171182
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
172183
# Include full git history needed for `yarn changeset status`
@@ -180,7 +191,4 @@ jobs:
180191
- name: Install
181192
run: yarn
182193
- name: Ensure changesets exist for each changed package
183-
# Skip on the release PR opened by the changesets action, where
184-
# changesets have already been consumed by `changeset version`.
185-
if: github.head_ref != 'changeset-release/main'
186194
run: yarn changeset status --since=origin/main

.github/workflows/create-release-pr.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,13 @@ jobs:
6565
env:
6666
RELEASE_BRANCH: changeset-release/main
6767
# Workflows that must leave the approval queue before this job is done. They
68-
# all trigger on `pull_request` to main with no path filters, so they always
69-
# run on the release PR; keep this list in step with them. Other pending runs
70-
# are still approved, just not waited for.
68+
# all trigger on `pull_request` to main with no path filters, so a run is
69+
# always created for the release PR; keep this list in step with them. Other
70+
# pending runs are still approved, just not waited for.
71+
#
72+
# ci is listed even though all its jobs skip on the release PR: the run is
73+
# queued for approval before those conditions are evaluated, so it would
74+
# otherwise sit pending forever. Waiting is what guarantees it was approved.
7175
EXPECTED_WORKFLOWS: ci npm-package-existence release-dry-run
7276
steps:
7377
- name: Approve workflow runs awaiting approval

0 commit comments

Comments
 (0)