Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ on:
required: true
default: false
type: boolean
artifact_run_id:
description: Exact prior publish run whose artifacts should be resumed
required: false
default: ""
type: string
source_ref:
description: Exact source SHA matching the recovery artifacts
required: false
default: ""
type: string

concurrency:
group: publish-${{ github.ref }}
Expand All @@ -41,6 +51,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
ref: ${{ inputs.source_ref || github.sha }}

- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
Expand Down Expand Up @@ -91,8 +102,10 @@ jobs:
# Keep this caller filename stable: npm trusted publishing authorizes it.
uses: stella/.github/.github/workflows/npm-independent-release.yml@b8c0884053fb8d4fb6ba157692189e0f1aae1785 # v1.6.0
with:
artifact-run-id: ${{ inputs.artifact_run_id || '' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require a source ref when resuming an artifact run

When a dispatcher supplies artifact_run_id but leaves the independently optional source_ref blank, the release downloads tarballs from the prior run while the pack checkout falls back to the current github.sha and the reusable workflow receives no matching source coordinate. If main has advanced since that run, recovery verifies different manifests/source from the selected artifacts, so it can fail or operate on the wrong release state. Reject this input combination at the workflow boundary, or derive the source SHA from the selected run.

AGENTS.md reference: AGENTS.md:L56-L56

Useful? React with 👍 / 👎.

artifact-pattern: npm-tarball-*
package-files: |
packages/typescript-config/package.json
packages/oxlint-config/package.json
packages/oxlint-plugin/package.json
source-ref: ${{ inputs.source_ref || '' }}
18 changes: 18 additions & 0 deletions scripts/bun-lock-workspace-versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,22 @@ describe("bun.lock workspace self-version synchronization", () => {
releaseJob.indexOf("uses: stella/.github/"),
);
});

test("manual recovery pins both the source and prior artifact run", async () => {
const publishWorkflow = await Bun.file(
new URL("../.github/workflows/publish.yml", import.meta.url),
).text();

expect(publishWorkflow).toContain("artifact_run_id:");
expect(publishWorkflow).toContain("source_ref:");
expect(publishWorkflow).toContain(
"ref: ${{ inputs.source_ref || github.sha }}",
);
expect(publishWorkflow).toContain(
"artifact-run-id: ${{ inputs.artifact_run_id || '' }}",
);
expect(publishWorkflow).toContain(
"source-ref: ${{ inputs.source_ref || '' }}",
);
});
});
Loading