Skip to content

Commit 7c9ad29

Browse files
npm: Ensure install downloads releases from the publisher repo
Ignore GITHUB_REPOSITORY when building the default release URL so npm installs always target the published shared-context-engineering releases. Keep SCE_NPM_RELEASE_BASE_URL as the only environment override and update the test to cover caller-repo execution. Co-authored-by: SCE <sce@crocoder.dev>
1 parent c02f07d commit 7c9ad29

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

npm/lib/install.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ function readPackageVersion() {
9797
}
9898

9999
function getRepositorySlug() {
100-
return process.env.GITHUB_REPOSITORY ?? DEFAULT_REPOSITORY_SLUG;
100+
return DEFAULT_REPOSITORY_SLUG;
101101
}
102102

103103
export function getReleaseBaseUrl(version) {
104104
return (
105105
process.env.SCE_NPM_RELEASE_BASE_URL ??
106-
`https://github.com/${getRepositorySlug()}/releases/download/v${version}`
106+
`https://github.com/${DEFAULT_REPOSITORY_SLUG}/releases/download/v${version}`
107107
);
108108
}
109109

npm/test/install.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ afterEach(() => {
5050
});
5151

5252
describe("release manifest verification primitives", () => {
53-
test("builds the default release base URL from the repository slug", () => {
53+
test("builds the default release base URL from the publisher repository slug", () => {
5454
const originalRepository = process.env.GITHUB_REPOSITORY;
5555
const originalReleaseBaseUrl = process.env.SCE_NPM_RELEASE_BASE_URL;
5656

5757
delete process.env.SCE_NPM_RELEASE_BASE_URL;
58-
process.env.GITHUB_REPOSITORY = "crocoder-dev/shared-context-engineering";
58+
process.env.GITHUB_REPOSITORY = "someone-else/caller-repo";
5959

6060
try {
6161
expect(getReleaseBaseUrl("0.1.0")).toBe(

0 commit comments

Comments
 (0)