Skip to content

Commit c08b88c

Browse files
authored
Merge branch 'main' into 143-oauth-enrichment-cover-all-pages-hide-handles-in-random-mode-explain-via-tooltip
2 parents b323a21 + 2551e20 commit c08b88c

6 files changed

Lines changed: 71 additions & 31 deletions

File tree

.agents/skills/writing-changesets/SKILL.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,10 @@ fixable error, not silently-missing release notes.
390390
## Publishing
391391

392392
See `docs/PUBLISHING.md` for how changesets are consumed at
393-
release time and how the manual-dispatch release workflow produces
394-
the git tag and GitHub Release.
393+
release time and how the release workflow (manual phase 1 to open
394+
the Release PR, automatic phase 2 to tag + publish the GitHub
395+
Release on Release-PR merge) produces the git tag and GitHub
396+
Release.
395397

396398
## Key files
397399

.changeset/clean-exit-on-expired-signin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
'ePDS': minor
2+
'ePDS': patch
33
---
44

55
Sign-in pages no longer strand users on a "session expired" dead end, and Resend no longer offers codes that won't work.

.changeset/par-heartbeat-keeps-slow-signins-alive.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
'ePDS': minor
2+
'ePDS': patch
33
---
44

55
Slow sign-ins are less likely to time out before you finish entering your code.

.github/workflows/release.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,25 @@ name: Release
22

33
on:
44
workflow_dispatch:
5+
# Auto-cut the tag + GitHub Release as soon as the "Version Packages"
6+
# PR is merged. Phase 1 (opening/updating that PR after a changeset
7+
# lands on main) is still triggered manually via workflow_dispatch.
8+
pull_request:
9+
types: [closed]
10+
branches: [main]
511

6-
concurrency: ${{ github.workflow }}-${{ github.ref }}
12+
concurrency: ${{ github.workflow }}-main
713

814
jobs:
915
release:
16+
# Skip when a non-release PR is closed, and when a release PR is
17+
# closed without being merged. The head ref of the release PR is
18+
# the branch changesets/action pushes to (`changeset-release/main`).
19+
if: >-
20+
github.event_name == 'workflow_dispatch' ||
21+
(github.event_name == 'pull_request' &&
22+
github.event.pull_request.merged == true &&
23+
github.event.pull_request.head.ref == 'changeset-release/main')
1024
runs-on: ubuntu-latest
1125
permissions:
1226
contents: write
@@ -22,17 +36,24 @@ jobs:
2236

2337
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2438
with:
39+
# On the pull_request trigger, github.ref points at the PR
40+
# merge ref; check out main explicitly so changesets/action
41+
# tags and pushes from the merged tip.
42+
ref: main
2543
# Persist releasebot app credentials so the changesets/action push
2644
# can bypass branch protection rules on main.
2745
token: ${{ steps.generate-token.outputs.token }}
2846
persist-credentials: true
2947
fetch-depth: 0
3048

31-
# Only main is supported. No beta/prerelease channel yet.
49+
# workflow_dispatch is constrained to main here as a defence in
50+
# depth — the pull_request trigger is already filtered to base
51+
# main + head changeset-release/main in the job-level `if` above.
3252
- name: Validate branch
53+
if: github.event_name == 'workflow_dispatch'
3354
run: |
3455
if [ "${{ github.ref }}" != "refs/heads/main" ]; then
35-
echo "::error::Release workflow can only be run from the 'main' branch."
56+
echo "::error::Release workflow can only be dispatched from the 'main' branch."
3657
exit 1
3758
fi
3859

AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,9 @@ GitHub Release per release.
425425
good and bad summaries, and the plain-language rule in detail.
426426
- **Cutting a release:** `docs/PUBLISHING.md` documents the release workflow
427427
for maintainers — the two-phase "Version Packages PR" → "tag + GitHub
428-
Release" flow via `.github/workflows/release.yml`.
428+
Release" flow via `.github/workflows/release.yml`. Phase 1 is triggered
429+
manually (`workflow_dispatch`); phase 2 fires automatically when the
430+
Release PR (head branch `changeset-release/main`) is merged into `main`.
429431

430432
## Key Gotchas
431433

docs/PUBLISHING.md

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,14 @@ document the decision.
116116

117117
## Cutting a release
118118

119-
Releases are manually triggered to give maintainers full control
120-
over timing.
119+
Releases happen in two phases:
120+
121+
- **Phase 1 (open the Release PR)** is triggered manually by a
122+
maintainer via `workflow_dispatch`. This gives you control over
123+
_when_ a release starts collecting changesets into a PR.
124+
- **Phase 2 (tag + publish the GitHub Release)** is triggered
125+
automatically when the Release PR is merged. No second manual
126+
click is needed.
121127

122128
1. **Prerequisites (one-time setup):**
123129
- The `hypercerts-release-bot` GitHub App must be installed on
@@ -127,24 +133,25 @@ over timing.
127133
repository secrets. This bot is used by the release workflow
128134
so that its automated "Version Packages" PR can bypass
129135
branch protection on `main`.
130-
2. **Run the workflow:**
136+
2. **Run the workflow (phase 1 — open the Release PR):**
131137
- Navigate to the
132138
[Release workflow](https://github.com/hypercerts-org/ePDS/actions/workflows/release.yml).
133139
- Click "Run workflow" and select the `main` branch.
134-
3. **What happens:**
140+
3. **What happens in phase 1:**
135141
- The workflow checks out the repo using the release-bot app
136142
token, runs `pnpm build / format:check / lint / typecheck /
137143
test` as a fail-fast gate, and then invokes
138144
`changesets/action`.
139145
- If there are pending changesets in `.changeset/`, the action
140-
opens (or updates) a **"Release" PR** against `main`. This
141-
PR applies the pending changesets: it bumps the root
142-
`ePDS` version, consumes the changeset files, and updates
143-
the root `CHANGELOG.md`. After `changeset version` has
144-
written the new release section, `scripts/changelog-audience-summary.mjs`
145-
runs as part of `pnpm version-packages` to post-process the
146-
section — it reads the `**Affects:**` line from each changeset
147-
bullet, groups summaries by audience (End users → Client app
146+
opens (or updates) a **"Release" PR** against `main` from the
147+
`changeset-release/main` branch. This PR applies the pending
148+
changesets: it bumps the root `ePDS` version, consumes the
149+
changeset files, and updates the root `CHANGELOG.md`. After
150+
`changeset version` has written the new release section,
151+
`scripts/changelog-audience-summary.mjs` runs as part of
152+
`pnpm version-packages` to post-process the section — it
153+
reads the `**Affects:**` line from each changeset bullet,
154+
groups summaries by audience (End users → Client app
148155
developers → Operators), prepends a "Who should read this
149156
release" block at the top of the section, and injects
150157
per-bullet HTML anchors so the summary links click through to
@@ -153,17 +160,25 @@ test` as a fail-fast gate, and then invokes
153160
workflow stops** — this is intentional so that a missed
154161
audience tag is surfaced immediately rather than becoming
155162
silently-missing release notes.
156-
- Review and merge the Release PR. This is the checkpoint
157-
where you verify the generated changelog and version number
158-
before they become permanent.
159-
- Re-run the Release workflow after the PR has been merged.
160-
This time there are no pending changesets but the tag is
161-
behind the `package.json` version, so the action runs
162-
`pnpm release` (`changeset tag`), creates a `v<version>`
163-
git tag, and publishes a single GitHub Release whose body
164-
is the matching section of `CHANGELOG.md`.
165-
- If there are no pending changesets and the tag is up to
166-
date, the workflow is a no-op.
163+
- If there are no pending changesets and the tag is up to date,
164+
phase 1 is a no-op.
165+
4. **Phase 2 — automatic tag + GitHub Release:**
166+
- Review and merge the Release PR when you're happy with the
167+
generated changelog and version number. This is the checkpoint
168+
where you verify them before they become permanent.
169+
- When the Release PR (head branch `changeset-release/main`)
170+
merges into `main`, the workflow re-runs automatically via
171+
its `pull_request: closed` trigger. There are no pending
172+
changesets at this point but the git tag is behind the
173+
`package.json` version, so the action runs `pnpm release`
174+
(`changeset tag`), creates a `v<version>` git tag, and
175+
publishes a single GitHub Release whose body is the matching
176+
section of `CHANGELOG.md`.
177+
- The auto-trigger only fires for PRs whose head ref is
178+
`changeset-release/main`. Merging any other PR into `main`
179+
does **not** start a release run.
180+
- You can re-trigger phase 2 manually via `workflow_dispatch` if
181+
the auto-run failed transiently.
167182

168183
## Validating PRs
169184

0 commit comments

Comments
 (0)