@effected/github-actions 0.33.1 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PackageManagerInstaller.js +20 -29
- package/index.d.ts +15 -17
- package/package.json +4 -4
|
@@ -97,7 +97,7 @@ var PackageManagerInstallerError = class extends Schema.TaggedError()("PackageMa
|
|
|
97
97
|
var AmbientPackageManager = class extends Schema.Class("AmbientPackageManager")({
|
|
98
98
|
/** The discriminant: the runner's own toolchain answered. */
|
|
99
99
|
source: Schema.tag("ambient"),
|
|
100
|
-
/** The package-manager name (`npm`, `pnpm
|
|
100
|
+
/** The package-manager name (`npm`, `pnpm` or `bun`). */
|
|
101
101
|
name: PackageManagerPinName,
|
|
102
102
|
/** The exact installed version, in string form. */
|
|
103
103
|
version: Schema.String,
|
|
@@ -118,8 +118,8 @@ var AmbientPackageManager = class extends Schema.Class("AmbientPackageManager")(
|
|
|
118
118
|
* bare name); for bun it is the entry directory itself, because the cached
|
|
119
119
|
* `bun` binary is directly executable and a shim would add nothing but a
|
|
120
120
|
* fork. `bins` still maps each published bin name to the underlying entry —
|
|
121
|
-
* a Node script to run with `node` for npm
|
|
122
|
-
* executable to run directly for bun and for pnpm
|
|
121
|
+
* a Node script to run with `node` for npm; an
|
|
122
|
+
* executable to run directly for bun and for pnpm, whose `pnpm` is the
|
|
123
123
|
* host's native binary (overlaid onto the cached wrapper the way pnpm's own
|
|
124
124
|
* install script does) and whose `pn`/`pnpx`/`pnx` are shell aliases of it.
|
|
125
125
|
* Each shim already applies that distinction. Calling `addPath` remains
|
|
@@ -132,7 +132,7 @@ var AmbientPackageManager = class extends Schema.Class("AmbientPackageManager")(
|
|
|
132
132
|
var CachedPackageManager = class extends Schema.Class("CachedPackageManager")({
|
|
133
133
|
/** The discriminant: the manager lives in the tool cache. */
|
|
134
134
|
source: Schema.tag("tool-cache"),
|
|
135
|
-
/** The package-manager name (`npm`, `pnpm
|
|
135
|
+
/** The package-manager name (`npm`, `pnpm` or `bun`). */
|
|
136
136
|
name: PackageManagerPinName,
|
|
137
137
|
/** The exact installed version, in string form. */
|
|
138
138
|
version: Schema.String,
|
|
@@ -194,14 +194,8 @@ const bunTarget = (runnerOs, arch) => {
|
|
|
194
194
|
const cpu = BUN_CPU[arch];
|
|
195
195
|
return os === void 0 || cpu === void 0 ? Option.none() : Option.some(`bun-${os}-${cpu}`);
|
|
196
196
|
};
|
|
197
|
-
/**
|
|
198
|
-
|
|
199
|
-
*
|
|
200
|
-
* The yarn split is corepack's own: `<2.0.0` is the `yarn` package, `>=2.0.0`
|
|
201
|
-
* (Berry) ships as `@yarnpkg/cli-dist` — a scoped package, whose tarball
|
|
202
|
-
* basename drops the scope (`/@yarnpkg/cli-dist/-/cli-dist-<v>.tgz`).
|
|
203
|
-
*/
|
|
204
|
-
const registryTarballUrl = (name, version, major, registry) => name === "yarn" && major >= 2 ? `${registry}/@yarnpkg/cli-dist/-/cli-dist-${version}.tgz` : `${registry}/${name}/-/${name}-${version}.tgz`;
|
|
197
|
+
/** The registry tarball url for an npm-registry-distributed manager. */
|
|
198
|
+
const registryTarballUrl = (name, version, registry) => `${registry}/${name}/-/${name}-${version}.tgz`;
|
|
205
199
|
/** Normalize a package.json `bin` value into name → relative path entries. */
|
|
206
200
|
const normalizeBins = (bin, fallbackName) => {
|
|
207
201
|
if (typeof bin === "string") return Option.some({ [fallbackName]: bin.replace(/^\.\//, "") });
|
|
@@ -292,13 +286,11 @@ const make = Effect.gen(function* () {
|
|
|
292
286
|
/**
|
|
293
287
|
* What a package directory's own manifest says about its entry points: the
|
|
294
288
|
* `bin` map, plus the `@pnpm/exe.*` optional dependencies that mark the
|
|
295
|
-
* pnpm
|
|
289
|
+
* pnpm native-binary layout (empty for every other manager). A pnpm
|
|
290
|
+
* artifact without one is refused as `layoutUnexpected`.
|
|
296
291
|
*
|
|
297
|
-
* Read from the artifact rather than hardcoded per manager
|
|
298
|
-
*
|
|
299
|
-
* `bin/pnpm.cjs` through v10 and `bin/pnpm.mjs` from v11, and from v12 the
|
|
300
|
-
* `pnpm` bin is a placeholder for a native binary shipped as a separate
|
|
301
|
-
* package. Both maps are attacker-supplied bytes and are normalized to
|
|
292
|
+
* Read from the artifact rather than hardcoded per manager: the `pnpm` bin
|
|
293
|
+
* is a placeholder for a native binary shipped as a separate package. Both maps are attacker-supplied bytes and are normalized to
|
|
302
294
|
* string → string before anything downstream reads them.
|
|
303
295
|
*/
|
|
304
296
|
const readPackageManifest = (pin, packageDir) => Effect.gen(function* () {
|
|
@@ -327,9 +319,14 @@ const make = Effect.gen(function* () {
|
|
|
327
319
|
}));
|
|
328
320
|
yield* assertFile(pin, target, `bin ${name} (${relative}) is missing`);
|
|
329
321
|
}
|
|
322
|
+
const nativePackages = nativePackagesOf(manifest.optionalDependencies);
|
|
323
|
+
if (pin.name === "pnpm" && Object.keys(nativePackages).length === 0) return yield* Effect.fail(errorFor(pin)({
|
|
324
|
+
reason: "layoutUnexpected",
|
|
325
|
+
subject: `package.json declares no ${PNPM_EXE_PREFIX}* optionalDependency`
|
|
326
|
+
}));
|
|
330
327
|
return {
|
|
331
328
|
bins,
|
|
332
|
-
nativePackages
|
|
329
|
+
nativePackages
|
|
333
330
|
};
|
|
334
331
|
});
|
|
335
332
|
/**
|
|
@@ -571,10 +568,9 @@ const make = Effect.gen(function* () {
|
|
|
571
568
|
const installFromRegistry = (pin, source) => Effect.gen(function* () {
|
|
572
569
|
const { name } = pin;
|
|
573
570
|
const version = pin.version.toString();
|
|
574
|
-
const url = registryTarballUrl(name, version,
|
|
571
|
+
const url = registryTarballUrl(name, version, source.registry);
|
|
575
572
|
const archive = yield* installer.download(url).pipe(Effect.mapError(fromInstaller(pin)));
|
|
576
|
-
|
|
577
|
-
if (!berry) yield* verifyIntegrity(pin, archive);
|
|
573
|
+
yield* verifyIntegrity(pin, archive);
|
|
578
574
|
const extracted = yield* installer.extractTar(archive).pipe(Effect.mapError(fromInstaller(pin)));
|
|
579
575
|
const packageDir = path.join(extracted, "package");
|
|
580
576
|
if ((yield* typeAt(fs, packageDir)) !== "Directory") return yield* Effect.fail(errorFor(pin)({
|
|
@@ -583,11 +579,6 @@ const make = Effect.gen(function* () {
|
|
|
583
579
|
}));
|
|
584
580
|
const manifest = yield* readPackageManifest(pin, packageDir);
|
|
585
581
|
const bins = Object.keys(manifest.nativePackages).length > 0 ? yield* overlayNativeBinary(pin, packageDir, manifest, source) : manifest.bins;
|
|
586
|
-
if (berry) {
|
|
587
|
-
const cli = path.join(packageDir, "bin/yarn.js");
|
|
588
|
-
yield* assertFile(pin, cli, "bin/yarn.js is missing from the cli-dist tarball");
|
|
589
|
-
yield* verifyIntegrity(pin, cli);
|
|
590
|
-
}
|
|
591
582
|
const destination = installer.cachePath(name, version);
|
|
592
583
|
yield* writeShims(pin, packageDir, destination, bins, { skipExisting: false });
|
|
593
584
|
const directory = yield* installer.cacheDir(packageDir, name, version).pipe(Effect.mapError(fromInstaller(pin)));
|
|
@@ -669,8 +660,8 @@ const dies = unstubbed("PackageManagerInstaller.makeTest");
|
|
|
669
660
|
* Takes a corepack pin (`@effected/npm`'s `PackageManagerPin`) and answers
|
|
670
661
|
* with an installed manager: tool-cache `find` first, then — for npm — an
|
|
671
662
|
* ambient `npm --version` probe (every Node toolchain ships npm), and only
|
|
672
|
-
* then the manager's own dist: npm
|
|
673
|
-
*
|
|
663
|
+
* then the manager's own dist: npm and pnpm from their registry tarballs,
|
|
664
|
+
* bun from its
|
|
674
665
|
* per-platform GitHub-release zip. An install with an expected integrity —
|
|
675
666
|
* the pin's `+<integrity>` tail or the `integrity` option — is verified
|
|
676
667
|
* fail-closed against what corepack itself hashes; one without proceeds with
|
package/index.d.ts
CHANGED
|
@@ -5287,7 +5287,7 @@ declare const PackageManagerInstallerError_base: Schema.Class<PackageManagerInst
|
|
|
5287
5287
|
*/
|
|
5288
5288
|
readonly reason: Schema.Literals<readonly ["downloadFailed", "extractFailed", "integrityMismatch", "integrityMissing", "unsupportedPlatform", "layoutUnexpected", "cacheFailed"]>;
|
|
5289
5289
|
/** The package manager being installed. */
|
|
5290
|
-
readonly name: Schema.Literals<readonly ["npm", "pnpm", "
|
|
5290
|
+
readonly name: Schema.Literals<readonly ["npm", "pnpm", "bun"]>;
|
|
5291
5291
|
/** The exact version being installed, in string form. */
|
|
5292
5292
|
readonly version: Schema.String;
|
|
5293
5293
|
/** What was being worked on — a url, a path, or an OS/arch pair. */
|
|
@@ -5331,15 +5331,14 @@ interface PackageManagerInstallOptions {
|
|
|
5331
5331
|
* Corepack form only (`<algo>.<hex>`), the same brand the pin's own
|
|
5332
5332
|
* `integrity` carries; convert a registry or lockfile SRI string with
|
|
5333
5333
|
* `CorepackIntegrityHash.fromSri` from `@effected/npm`. It verifies
|
|
5334
|
-
* exactly what a pin integrity verifies — the registry tarball for npm
|
|
5335
|
-
*
|
|
5336
|
-
* for bun — and stands in for the pin's in every rule: it silences the
|
|
5334
|
+
* exactly what a pin integrity verifies — the registry tarball for npm
|
|
5335
|
+
* and pnpm, the platform zip for bun — and stands in for the pin's in every rule: it silences the
|
|
5337
5336
|
* "carries no integrity hash" warning, satisfies `requireIntegrity`, and a
|
|
5338
5337
|
* tool-cache hit is answered without re-verifying, exactly as it is for an
|
|
5339
5338
|
* integrity-carrying pin.
|
|
5340
5339
|
*
|
|
5341
5340
|
* Fail-closed, before any cache lookup or download: a value not in corepack
|
|
5342
|
-
* form (an SRI
|
|
5341
|
+
* form (an SRI hash) fails with `integrityMismatch` on its
|
|
5343
5342
|
* could-not-verify arm (no `expected`, no `actual`, `subject` naming the
|
|
5344
5343
|
* option); and when the pin also carries an integrity and the two differ,
|
|
5345
5344
|
* the install fails with `integrityMismatch` (`expected` is this option,
|
|
@@ -5349,10 +5348,10 @@ interface PackageManagerInstallOptions {
|
|
|
5349
5348
|
*/
|
|
5350
5349
|
readonly integrity?: IntegrityHashBrand | undefined;
|
|
5351
5350
|
/**
|
|
5352
|
-
* The npm registry host the npm
|
|
5351
|
+
* The npm registry host the npm and pnpm tarballs download from.
|
|
5353
5352
|
* Defaults to `https://registry.npmjs.org`. A corporate mirror qualifies
|
|
5354
5353
|
* when it serves the standard `/<name>/-/<basename>-<version>.tgz` tarball
|
|
5355
|
-
* route and — for pnpm
|
|
5354
|
+
* route and — for pnpm, whose native binary is a second
|
|
5356
5355
|
* artifact verified against the registry's own integrity — the
|
|
5357
5356
|
* `/<name>/<version>` packument route as JSON carrying `dist.integrity`.
|
|
5358
5357
|
* A tarball-only proxy fails a pnpm 12 pin with `downloadFailed` naming
|
|
@@ -5368,8 +5367,7 @@ interface PackageManagerInstallOptions {
|
|
|
5368
5367
|
* entry.
|
|
5369
5368
|
*
|
|
5370
5369
|
* @remarks
|
|
5371
|
-
* Consulted only for a pin whose wrapper overlays a native binary (pnpm
|
|
5372
|
-
* and later); every other pin ignores it. When supplied, the installer
|
|
5370
|
+
* Consulted only for a pin whose wrapper overlays a native binary (pnpm); every other pin ignores it. When supplied, the installer
|
|
5373
5371
|
* verifies the host's `@pnpm/exe.<target>` tarball against this map's entry
|
|
5374
5372
|
* (its strongest listed algorithm) INSTEAD of the registry's packument, so
|
|
5375
5373
|
* the packument route is never requested and a tarball-only mirror
|
|
@@ -5402,8 +5400,8 @@ interface PackageManagerInstallOptions {
|
|
|
5402
5400
|
declare const AmbientPackageManager_base: Schema.Class<AmbientPackageManager, Schema.Struct<{
|
|
5403
5401
|
/** The discriminant: the runner's own toolchain answered. */
|
|
5404
5402
|
readonly source: Schema.tag<"ambient">;
|
|
5405
|
-
/** The package-manager name (`npm`, `pnpm
|
|
5406
|
-
readonly name: Schema.Literals<readonly ["npm", "pnpm", "
|
|
5403
|
+
/** The package-manager name (`npm`, `pnpm` or `bun`). */
|
|
5404
|
+
readonly name: Schema.Literals<readonly ["npm", "pnpm", "bun"]>;
|
|
5407
5405
|
/** The exact installed version, in string form. */
|
|
5408
5406
|
readonly version: Schema.String;
|
|
5409
5407
|
/** Bin name → the ambient command name that invokes it. */
|
|
@@ -5423,8 +5421,8 @@ export declare class AmbientPackageManager extends AmbientPackageManager_base {}
|
|
|
5423
5421
|
declare const CachedPackageManager_base: Schema.Class<CachedPackageManager, Schema.Struct<{
|
|
5424
5422
|
/** The discriminant: the manager lives in the tool cache. */
|
|
5425
5423
|
readonly source: Schema.tag<"tool-cache">;
|
|
5426
|
-
/** The package-manager name (`npm`, `pnpm
|
|
5427
|
-
readonly name: Schema.Literals<readonly ["npm", "pnpm", "
|
|
5424
|
+
/** The package-manager name (`npm`, `pnpm` or `bun`). */
|
|
5425
|
+
readonly name: Schema.Literals<readonly ["npm", "pnpm", "bun"]>;
|
|
5428
5426
|
/** The exact installed version, in string form. */
|
|
5429
5427
|
readonly version: Schema.String;
|
|
5430
5428
|
/** The cached entry: `<tool-cache>/<name>/<version>/<arch>`. */
|
|
@@ -5448,8 +5446,8 @@ declare const CachedPackageManager_base: Schema.Class<CachedPackageManager, Sche
|
|
|
5448
5446
|
* bare name); for bun it is the entry directory itself, because the cached
|
|
5449
5447
|
* `bun` binary is directly executable and a shim would add nothing but a
|
|
5450
5448
|
* fork. `bins` still maps each published bin name to the underlying entry —
|
|
5451
|
-
* a Node script to run with `node` for npm
|
|
5452
|
-
* executable to run directly for bun and for pnpm
|
|
5449
|
+
* a Node script to run with `node` for npm; an
|
|
5450
|
+
* executable to run directly for bun and for pnpm, whose `pnpm` is the
|
|
5453
5451
|
* host's native binary (overlaid onto the cached wrapper the way pnpm's own
|
|
5454
5452
|
* install script does) and whose `pn`/`pnpx`/`pnx` are shell aliases of it.
|
|
5455
5453
|
* Each shim already applies that distinction. Calling `addPath` remains
|
|
@@ -5507,8 +5505,8 @@ declare const PackageManagerInstaller_base: Context.ServiceClass<PackageManagerI
|
|
|
5507
5505
|
* Takes a corepack pin (`@effected/npm`'s `PackageManagerPin`) and answers
|
|
5508
5506
|
* with an installed manager: tool-cache `find` first, then — for npm — an
|
|
5509
5507
|
* ambient `npm --version` probe (every Node toolchain ships npm), and only
|
|
5510
|
-
* then the manager's own dist: npm
|
|
5511
|
-
*
|
|
5508
|
+
* then the manager's own dist: npm and pnpm from their registry tarballs,
|
|
5509
|
+
* bun from its
|
|
5512
5510
|
* per-platform GitHub-release zip. An install with an expected integrity —
|
|
5513
5511
|
* the pin's `+<integrity>` tail or the `integrity` option — is verified
|
|
5514
5512
|
* fail-closed against what corepack itself hashes; one without proceeds with
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effected/github-actions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The GitHub Actions runtime: env, inputs, outputs, state, logging, cache, artifacts, blob storage, OIDC and the token bridge.",
|
|
6
6
|
"keywords": [
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"@effected/crypto": "^0.7.0",
|
|
43
43
|
"@effected/github": "^0.32.1",
|
|
44
44
|
"@effected/github-commands": "^0.10.0",
|
|
45
|
-
"@effected/glob": "^0.
|
|
45
|
+
"@effected/glob": "^0.22.0",
|
|
46
46
|
"@effected/jwt": "^0.10.0",
|
|
47
47
|
"@effected/markdown": "^0.29.0",
|
|
48
|
-
"@effected/npm": "^0.
|
|
48
|
+
"@effected/npm": "^0.35.0",
|
|
49
49
|
"@effected/oidc": "^0.5.0",
|
|
50
50
|
"@effected/sbom": "^0.21.0",
|
|
51
51
|
"@effected/semver": "^0.24.0",
|
|
52
52
|
"@effected/templates": "^0.20.0",
|
|
53
|
-
"@effected/walker": "^0.
|
|
53
|
+
"@effected/walker": "^0.29.0",
|
|
54
54
|
"@effected/yaml": "^0.30.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|