Skip to content

Commit fbd5a22

Browse files
committed
fix: limit Release Please push trigger
1 parent 3180b52 commit fbd5a22

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- package.json
79
workflow_dispatch:
810

911
permissions:

RELEASING.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,12 @@ The repository maintains four independently auditable workflows:
238238
`RELEASE_PLEASE_ENABLED=true` and uses the default `GITHUB_TOKEN`. The
239239
authorized repository baseline keeps default workflow permissions read-only
240240
and allows Actions to create pull requests; it does not make bot review valid
241-
release approval. A manual dispatch is attempt-1-only, runs with GitHub Release
242-
creation disabled, and prepares exactly one action-authored patch PR after the
243-
variable is enabled. A new dispatch may revalidate an unchanged canonical PR
241+
release approval. Automatic push execution is limited to `main` commits that
242+
change canonical `package.json`, so ordinary repair and documentation merges
243+
cannot be mistaken for an already published version. A manual dispatch is
244+
attempt-1-only, runs with GitHub Release creation disabled, and prepares
245+
exactly one action-authored patch PR after the variable is enabled. A new
246+
dispatch may revalidate an unchanged canonical PR
244247
even when Release Please returns no PR output. The preparation run succeeds
245248
only after independently verifying the canonical branch, title,
246249
machine-readable body, pending label, four expected release files, and 0.1.x

tests/workflow-contract.test.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ describe("GitHub Actions workflow contract", () => {
202202
"continue-on-error: ${{ steps.preflight.outputs.mode == 'release' }}",
203203
);
204204
expect(contents).not.toContain("token:");
205+
expect(contents).toMatch(
206+
/^ {2}push:\n {4}branches:\n {6}- main\n {4}paths:\n {6}- package\.json$/m,
207+
);
205208
expect(contents).toMatch(/^ {2}workflow_dispatch:$/m);
206209
expect(contents).toContain("group: release-please-main");
207210
expect(releasePlease).toContain("RUN_ATTEMPT: ${{ github.run_attempt }}");

0 commit comments

Comments
 (0)