Skip to content

Commit ab5aa26

Browse files
committed
fix: require refreshed release candidate
1 parent 453135e commit ab5aa26

5 files changed

Lines changed: 28 additions & 19 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,11 @@ jobs:
658658
"+refs/heads/${RELEASE_BRANCH}:refs/remotes/origin/${RELEASE_BRANCH}"
659659
release_ref="refs/remotes/origin/${RELEASE_BRANCH}"
660660
branch_sha="$(git rev-parse "$release_ref")"
661+
branch_parent="$(git rev-parse "${release_ref}^")"
662+
if [[ "$branch_parent" != "$GITHUB_SHA" ]]; then
663+
echo "The prepared Release Please branch is not based directly on current main." >&2
664+
exit 1
665+
fi
661666
gh api --paginate --slurp \
662667
"repos/${GITHUB_REPOSITORY}/pulls?state=open&base=main&per_page=100" \
663668
| jq 'add' > "$pull_requests_file"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ For source-checkout testing, retain and verify one exact tarball:
5858
```bash
5959
mkdir -p .artifacts
6060
npm pack --pack-destination .artifacts
61-
npm run test:package -- --tarball .artifacts/cometapi-0.1.1.tgz
62-
npm run test:examples -- --tarball .artifacts/cometapi-0.1.1.tgz
63-
npm run test:fixtures -- --tarball .artifacts/cometapi-0.1.1.tgz
61+
npm run test:package -- --tarball .artifacts/cometapi-$(node -p 'require("./package.json").version').tgz
62+
npm run test:examples -- --tarball .artifacts/cometapi-$(node -p 'require("./package.json").version').tgz
63+
npm run test:fixtures -- --tarball .artifacts/cometapi-$(node -p 'require("./package.json").version').tgz
6464
```
6565

6666
Install that path in a separate consumer when needed. Do not treat a locally

RELEASING.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -526,13 +526,12 @@ mutate the release branch during that window. The workflow repeats those checks
526526
after the action and stops publication on any drift, but it cannot delete or
527527
replace an immutable Release created during an external race.
528528

529-
The stale branch
530-
`release-please--branches--main--components--cometapi` at
531-
`3f0949e5c0ccd0923d10595437f7a315f013af7c` is the failed run's evidence, not a
532-
release candidate. Immediately before replacing or deleting it, confirm that
533-
it still contains the documented generated 0.2.0 state, has no associated open
534-
PR, and contains no independent work. Do not delete or rewrite any other
535-
branch.
529+
The stale branch at `3f0949e5c0ccd0923d10595437f7a315f013af7c` was revalidated
530+
as the failed run's generated 0.2.0 evidence, with no associated open PR or
531+
independent work, then deleted. Release Please recreated the canonical
532+
`release-please--branches--main--components--cometapi` branch for the
533+
action-owned 0.1.1 PR. Do not use that branch as a 0.2 starting point or delete
534+
or rewrite any other branch.
536535
537536
For 0.1.1, `always-bump-patch` keeps every releasable Conventional Commit on the
538537
0.1.x maintenance line; changing that strategy requires a separately authorized
@@ -651,11 +650,9 @@ layers:
651650
`3f0949e5c0ccd0923d10595437f7a315f013af7c`, a generated `0.2.0` draft, but
652651
before creating a pull request. It did not modify `main`, create a tag, or
653652
publish a package. `RELEASE_PLEASE_ENABLED` was set to `false` before the
654-
closeout push; the branch is retained as failure evidence and must not be
655-
merged or treated as the start of 0.2. Release Please remains disabled until
656-
the authorized 0.1.1 repair is merged, the stale branch is revalidated and
657-
removed, and the normal action-created PR path is ready for one first-attempt
658-
preparation run.
653+
closeout push. During the authorized 0.1.1 repair, the branch was revalidated
654+
as failure-only evidence with no associated PR or independent work, deleted,
655+
and then recreated by Release Please for the normal action-owned 0.1.1 PR.
659656
660657
## Verification record
661658

ROADMAP.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,11 @@ attempt, and exact Release state; manual preparation remains attempt-1-only.
128128
The Release notes must equal the reviewed `CHANGELOG` entry. The post-merge run
129129
also requires an administrator's approval on the release PR's final head.
130130

131-
The exact stale branch remains failure evidence until its contents, lack of an
132-
open PR, and lack of independent work are reconfirmed immediately before
133-
cleanup. It must never be merged or treated as the start of 0.2. Repository
134-
foundation may become Complete only after the real 0.1.1 release flow, public
131+
The exact stale 0.2 branch was revalidated as failure-only evidence with no
132+
associated PR or independent work, then deleted. Release Please recreated the
133+
canonical branch for the action-owned 0.1.1 PR; it must never be treated as the
134+
start of 0.2. Repository foundation may become Complete only after the real
135+
0.1.1 release flow, public
135136
registry installation, and a separate post-release documentation PR recording
136137
ROADMAP and RELEASING evidence succeed. Until then,
137138
`RELEASE_PLEASE_ENABLED` remains a temporary release-operation control,

tests/workflow-contract.test.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ describe("GitHub Actions workflow contract", () => {
243243
"release-please-result-${{ github.run_id }}-${{ github.run_attempt }}",
244244
);
245245
expect(releasePlease).toContain("validateReleasePleaseActionResult");
246+
expect(releasePlease).toContain(
247+
'branch_parent="$(git rev-parse "${release_ref}^")"',
248+
);
249+
expect(releasePlease).toContain(
250+
'if [[ "$branch_parent" != "$GITHUB_SHA" ]]',
251+
);
246252
expect(releasePlease).toContain("schemaVersion: 2");
247253
expect(releasePlease).toContain("actionOutcome");
248254
expect(releasePlease).toContain("recovered");

0 commit comments

Comments
 (0)