@effected/github-actions 0.23.1 → 0.25.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/Action.js +1 -2
- package/ActionCache.js +1 -2
- package/ActionEnvironment.js +7 -10
- package/ActionInput.js +15 -19
- package/ActionLogger.js +1 -2
- package/ActionOutputs.js +1 -2
- package/ActionState.js +1 -2
- package/ActionsIdentityToken.js +6 -7
- package/ActionsProvenance.js +18 -17
- package/Artifact.js +4 -4
- package/BlobEnvelope.js +1 -2
- package/BlobStore.githubCache.js +1 -2
- package/BlobStore.js +59 -30
- package/BlobTransfer.js +1 -2
- package/CacheKey.js +1 -2
- package/CheckDocument.js +1 -2
- package/CheckState.js +1 -2
- package/ChildEnv.js +1 -2
- package/DetachedProcess.js +1 -2
- package/DryRun.js +1 -2
- package/GitHubMarkdown.js +1 -2
- package/GitHubToken.js +1 -2
- package/ManagedDocument.js +1 -2
- package/OidcTokenIssuer.js +24 -54
- package/PackageManagerInstaller.js +20 -24
- package/README.md +3 -3
- package/Secret.js +11 -8
- package/ToolInstaller.js +4 -4
- package/index.d.ts +51 -125
- package/index.js +2 -2
- package/internal/actionsResults.js +6 -6
- package/internal/archiveCommands.js +1 -2
- package/internal/cacheService.js +1 -2
- package/internal/digest.js +1 -2
- package/internal/fsProbe.js +1 -2
- package/internal/json.js +11 -0
- package/internal/pnpmExe.js +1 -2
- package/internal/runner.js +22 -3
- package/internal/runnerFile.js +1 -2
- package/internal/shim.js +1 -2
- package/internal/spawn.js +1 -2
- package/internal/twirp.js +1 -2
- package/internal/unstubbed.js +1 -2
- package/package.json +13 -10
- package/internal/jwt.js +0 -42
- package/internal/sigv4.js +0 -115
package/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AnnotationProperties, AnnotationProperties as AnnotationProperties$1, WorkflowCommand } from "@effected/github-commands";
|
|
2
2
|
import { NodeServices } from "@effect/platform-node";
|
|
3
|
-
import { Cause, Config, ConfigProvider, Context, Duration, Effect, FileSystem, Layer, Logger, Option, Path, Redacted, Result, Schema } from "effect";
|
|
3
|
+
import { Cause, Config, ConfigProvider, Context, Crypto, Duration, Effect, FileSystem, Layer, Logger, Option, Path, Redacted, Result, Schema } from "effect";
|
|
4
4
|
import { HttpClient } from "effect/http";
|
|
5
5
|
import { ChildProcessSpawner } from "effect/process";
|
|
6
|
-
import { IdentityToken
|
|
7
|
-
import { BotIdentity, GitHubApp, GitHubClient, InstallationToken, PermissionLevel, RetryPolicy } from "@effected/github";
|
|
6
|
+
import { IdentityToken } from "@effected/oidc";
|
|
7
|
+
import { ActionsOidcClaims, BotIdentity, GitHubApp, GitHubClient, InstallationToken, PermissionLevel, RetryPolicy } from "@effected/github";
|
|
8
|
+
import { SlsaProvenance } from "@effected/sbom";
|
|
8
9
|
import { IntegrityHashBrand, PackageManagerPin } from "@effected/npm";
|
|
9
|
-
//#region src/ActionEnvironment.d.ts
|
|
10
10
|
declare const ActionEnvironmentError_base: Schema.Class<ActionEnvironmentError, Schema.TaggedStruct<"ActionEnvironmentError", {
|
|
11
11
|
/** `missing` — absent or empty; `malformed` — present but unusable. */
|
|
12
12
|
readonly reason: Schema.Literals<readonly ["missing", "malformed"]>;
|
|
@@ -259,8 +259,6 @@ export declare class ActionEnvironment extends ActionEnvironment_base {
|
|
|
259
259
|
*/
|
|
260
260
|
static readonly layerTest: (overrides?: Readonly<Record<string, string>>, payload?: unknown) => Layer.Layer<ActionEnvironment>;
|
|
261
261
|
}
|
|
262
|
-
//#endregion
|
|
263
|
-
//#region src/ActionLogger.d.ts
|
|
264
262
|
/**
|
|
265
263
|
* Options for {@link ActionLoggerShape.withBuffer}.
|
|
266
264
|
*
|
|
@@ -453,8 +451,6 @@ export declare class ActionLogger extends ActionLogger_base {
|
|
|
453
451
|
*/
|
|
454
452
|
static readonly layerSilent: Layer.Layer<ActionLogger>;
|
|
455
453
|
}
|
|
456
|
-
//#endregion
|
|
457
|
-
//#region src/ActionOutputs.d.ts
|
|
458
454
|
declare const RunnerFileUnavailableError_base: Schema.Class<RunnerFileUnavailableError, Schema.TaggedStruct<"RunnerFileUnavailableError", {
|
|
459
455
|
/** The runner file involved, by environment variable name. */
|
|
460
456
|
readonly file: Schema.String;
|
|
@@ -735,8 +731,6 @@ export declare class ActionOutputs extends ActionOutputs_base {
|
|
|
735
731
|
*/
|
|
736
732
|
static readonly recording: () => RecordingOutputs;
|
|
737
733
|
}
|
|
738
|
-
//#endregion
|
|
739
|
-
//#region src/ActionState.d.ts
|
|
740
734
|
declare const ActionStateError_base: Schema.Class<ActionStateError, Schema.TaggedStruct<"ActionStateError", {
|
|
741
735
|
/**
|
|
742
736
|
* `missing` — no value was saved under this key in an earlier phase.
|
|
@@ -848,8 +842,6 @@ export declare class ActionState extends ActionState_base {
|
|
|
848
842
|
/** {@link ActionState.makeTest} behind `Layer.succeed`. */
|
|
849
843
|
static readonly layerTest: (overrides?: Partial<ActionStateShape>) => Layer.Layer<ActionState>;
|
|
850
844
|
}
|
|
851
|
-
//#endregion
|
|
852
|
-
//#region src/Action.d.ts
|
|
853
845
|
/**
|
|
854
846
|
* Everything {@link ActionRuntime.layer} provides.
|
|
855
847
|
*
|
|
@@ -999,8 +991,6 @@ export declare class Action {
|
|
|
999
991
|
*/
|
|
1000
992
|
static readonly run: <E, R = never>(program: Effect.Effect<void, E, ActionServices | R>, options?: ActionRunOptions<R>) => Promise<void>;
|
|
1001
993
|
}
|
|
1002
|
-
//#endregion
|
|
1003
|
-
//#region src/BlobTransfer.d.ts
|
|
1004
994
|
declare const BlobTransferError_base: Schema.Class<BlobTransferError, Schema.TaggedStruct<"BlobTransferError", {
|
|
1005
995
|
/** Which direction failed. */
|
|
1006
996
|
readonly reason: Schema.Literals<readonly ["uploadFailed", "downloadFailed"]>;
|
|
@@ -1058,8 +1048,6 @@ interface DataBlobTransfer {
|
|
|
1058
1048
|
/** Download the url's contents. */
|
|
1059
1049
|
readonly downloadToBuffer: (url: string) => Effect.Effect<Uint8Array, BlobTransferError>;
|
|
1060
1050
|
}
|
|
1061
|
-
//#endregion
|
|
1062
|
-
//#region src/CacheKey.d.ts
|
|
1063
1051
|
declare const CacheKeyReadError_base: Schema.Class<CacheKeyReadError, Schema.TaggedStruct<"CacheKeyReadError", {
|
|
1064
1052
|
/** The path being read when it went wrong. */
|
|
1065
1053
|
readonly path: Schema.String;
|
|
@@ -1410,8 +1398,6 @@ export declare class CacheKey extends CacheKey_base {
|
|
|
1410
1398
|
readonly patterns: ReadonlyArray<string>;
|
|
1411
1399
|
}) => Effect.Effect<Option.Option<string>, CacheKeyBadPatternError | CacheKeyReadError, FileSystem.FileSystem | Path.Path>;
|
|
1412
1400
|
}
|
|
1413
|
-
//#endregion
|
|
1414
|
-
//#region src/ActionCache.d.ts
|
|
1415
1401
|
declare const ActionCacheError_base: Schema.Class<ActionCacheError, Schema.TaggedStruct<"ActionCacheError", {
|
|
1416
1402
|
/**
|
|
1417
1403
|
* `misconfigured` — the results backend is not reachable from here (see
|
|
@@ -1550,8 +1536,6 @@ export declare class ActionCache extends ActionCache_base {
|
|
|
1550
1536
|
/** {@link ActionCache.makeTest} behind `Layer.succeed`. */
|
|
1551
1537
|
static readonly layerTest: (overrides?: Partial<ActionCacheShape>) => Layer.Layer<ActionCache>;
|
|
1552
1538
|
}
|
|
1553
|
-
//#endregion
|
|
1554
|
-
//#region src/ActionInput.d.ts
|
|
1555
1539
|
/**
|
|
1556
1540
|
* Options for {@link ActionInput.pairs}.
|
|
1557
1541
|
*
|
|
@@ -1944,8 +1928,6 @@ export declare class ActionInput {
|
|
|
1944
1928
|
*/
|
|
1945
1929
|
static readonly layerDefault: Layer.Layer<never>;
|
|
1946
1930
|
}
|
|
1947
|
-
//#endregion
|
|
1948
|
-
//#region src/OidcTokenIssuer.d.ts
|
|
1949
1931
|
declare const OidcTokenError_base: Schema.Class<OidcTokenError, Schema.TaggedStruct<"OidcTokenError", {
|
|
1950
1932
|
/**
|
|
1951
1933
|
* `unavailable` — the runner did not publish the token-service variables,
|
|
@@ -1972,45 +1954,6 @@ declare const OidcTokenError_base: Schema.Class<OidcTokenError, Schema.TaggedStr
|
|
|
1972
1954
|
export declare class OidcTokenError extends OidcTokenError_base {
|
|
1973
1955
|
get message(): string;
|
|
1974
1956
|
}
|
|
1975
|
-
declare const OidcClaims_base: Schema.Class<OidcClaims, Schema.Struct<{
|
|
1976
|
-
/** The issuer, e.g. `https://token.actions.githubusercontent.com`. */
|
|
1977
|
-
readonly iss: Schema.String;
|
|
1978
|
-
/** The full ref the workflow ran on. */
|
|
1979
|
-
readonly ref: Schema.String;
|
|
1980
|
-
/** The commit. */
|
|
1981
|
-
readonly sha: Schema.String;
|
|
1982
|
-
/** `owner/repo`. */
|
|
1983
|
-
readonly repository: Schema.String;
|
|
1984
|
-
/** The event that triggered the run. */
|
|
1985
|
-
readonly event_name: Schema.String;
|
|
1986
|
-
/** The reusable-workflow ref, which is what a verifier pins against. */
|
|
1987
|
-
readonly job_workflow_ref: Schema.String;
|
|
1988
|
-
/** The calling workflow's ref. */
|
|
1989
|
-
readonly workflow_ref: Schema.String;
|
|
1990
|
-
/** The numeric repository id, as a string. */
|
|
1991
|
-
readonly repository_id: Schema.String;
|
|
1992
|
-
/** The numeric owner id, as a string. */
|
|
1993
|
-
readonly repository_owner_id: Schema.String;
|
|
1994
|
-
/** `github-hosted` or `self-hosted`. */
|
|
1995
|
-
readonly runner_environment: Schema.String;
|
|
1996
|
-
/** The run id, as a string. */
|
|
1997
|
-
readonly run_id: Schema.String;
|
|
1998
|
-
/** The run attempt, as a string. */
|
|
1999
|
-
readonly run_attempt: Schema.String;
|
|
2000
|
-
}>, {}>;
|
|
2001
|
-
/**
|
|
2002
|
-
* The claims a GitHub Actions OIDC token carries about the workflow that ran.
|
|
2003
|
-
*
|
|
2004
|
-
* @remarks
|
|
2005
|
-
* The field names are GitHub's own JWT claim names, kept verbatim rather than
|
|
2006
|
-
* translated to the kit's casing. They are an **external vocabulary** — the
|
|
2007
|
-
* same strings that appear in a SLSA provenance predicate and in every
|
|
2008
|
-
* published example of an Actions OIDC policy — and renaming them would put a
|
|
2009
|
-
* translation layer between a consumer and the specification they are reading.
|
|
2010
|
-
*
|
|
2011
|
-
* @public
|
|
2012
|
-
*/
|
|
2013
|
-
export declare class OidcClaims extends OidcClaims_base {}
|
|
2014
1957
|
/**
|
|
2015
1958
|
* The members of the {@link OidcTokenIssuer} service: request an ID `token`
|
|
2016
1959
|
* and read its decoded `claims`, both failing with {@link OidcTokenError}.
|
|
@@ -2028,7 +1971,8 @@ interface OidcTokenIssuerShape {
|
|
|
2028
1971
|
*/
|
|
2029
1972
|
readonly token: (audience?: string) => Effect.Effect<Redacted.Redacted<string>, OidcTokenError>;
|
|
2030
1973
|
/**
|
|
2031
|
-
* The token's claims, decoded
|
|
1974
|
+
* The token's claims, decoded into `@effected/github`'s `ActionsOidcClaims`,
|
|
1975
|
+
* the same class `ActionsOidc.verify` returns.
|
|
2032
1976
|
*
|
|
2033
1977
|
* @remarks
|
|
2034
1978
|
* **The signature is deliberately not verified**, for three reasons that are
|
|
@@ -2053,7 +1997,7 @@ interface OidcTokenIssuerShape {
|
|
|
2053
1997
|
* a test cannot silently skip the path under test because the double
|
|
2054
1998
|
* returned a token that is not a JWT.
|
|
2055
1999
|
*/
|
|
2056
|
-
readonly claims: (audience?: string) => Effect.Effect<
|
|
2000
|
+
readonly claims: (audience?: string) => Effect.Effect<ActionsOidcClaims, OidcTokenError>;
|
|
2057
2001
|
}
|
|
2058
2002
|
declare const OidcTokenIssuer_base: Context.ServiceClass<OidcTokenIssuer, "@effected/github-actions/OidcTokenIssuer", OidcTokenIssuerShape>;
|
|
2059
2003
|
/**
|
|
@@ -2073,7 +2017,7 @@ declare const OidcTokenIssuer_base: Context.ServiceClass<OidcTokenIssuer, "@effe
|
|
|
2073
2017
|
* const program = Effect.gen(function* () {
|
|
2074
2018
|
* const issuer = yield* OidcTokenIssuer;
|
|
2075
2019
|
* const claims = yield* issuer.claims("sigstore");
|
|
2076
|
-
* return claims.
|
|
2020
|
+
* return claims.jobWorkflowRef;
|
|
2077
2021
|
* });
|
|
2078
2022
|
* ```
|
|
2079
2023
|
*
|
|
@@ -2097,7 +2041,7 @@ export declare class OidcTokenIssuer extends OidcTokenIssuer_base {
|
|
|
2097
2041
|
* double returning a synthetic non-JWT would make the provenance path
|
|
2098
2042
|
* structurally unreachable in a test.
|
|
2099
2043
|
*/
|
|
2100
|
-
static readonly unsignedTokenFor: (claims:
|
|
2044
|
+
static readonly unsignedTokenFor: (claims: ActionsOidcClaims) => Redacted.Redacted<string>;
|
|
2101
2045
|
/** A test double. Unstubbed members die rather than answering with a non-token. */
|
|
2102
2046
|
static readonly makeTest: (overrides?: Partial<OidcTokenIssuerShape>) => OidcTokenIssuerShape;
|
|
2103
2047
|
/** {@link OidcTokenIssuer.makeTest} behind `Layer.succeed`. */
|
|
@@ -2112,18 +2056,16 @@ export declare class OidcTokenIssuer extends OidcTokenIssuer_base {
|
|
|
2112
2056
|
* members can disagree is how a test proves a path works while production
|
|
2113
2057
|
* takes the other one.
|
|
2114
2058
|
*/
|
|
2115
|
-
static readonly layerFor: (claims:
|
|
2059
|
+
static readonly layerFor: (claims: ActionsOidcClaims) => Layer.Layer<OidcTokenIssuer>;
|
|
2116
2060
|
}
|
|
2117
|
-
//#endregion
|
|
2118
|
-
//#region src/ActionsIdentityToken.d.ts
|
|
2119
2061
|
/**
|
|
2120
|
-
* Serves `@effected/
|
|
2062
|
+
* Serves `@effected/oidc`'s `IdentityToken` contract from the runner's own OIDC
|
|
2121
2063
|
* token service, so signing an SBOM inside a workflow needs no further wiring.
|
|
2122
2064
|
*
|
|
2123
2065
|
* @remarks
|
|
2124
|
-
* `@effected/
|
|
2125
|
-
* one redacted token — precisely so that
|
|
2126
|
-
*
|
|
2066
|
+
* `@effected/oidc` declares `IdentityToken` — one method, one audience,
|
|
2067
|
+
* one redacted token — precisely so that a consumer of a token, such as
|
|
2068
|
+
* `@effected/sbom`'s signer, does not drag the Actions runtime in. This is the
|
|
2127
2069
|
* layer that closes the inversion from the other side: it serves that contract
|
|
2128
2070
|
* from the runner's own OIDC token service ({@link OidcTokenIssuer}), the same
|
|
2129
2071
|
* arrangement as `@effected/workspaces` implementing `@effected/commands`'
|
|
@@ -2167,20 +2109,20 @@ export declare class ActionsIdentityToken {
|
|
|
2167
2109
|
*/
|
|
2168
2110
|
static readonly layer: Layer.Layer<IdentityToken, never, OidcTokenIssuer>;
|
|
2169
2111
|
}
|
|
2170
|
-
//#endregion
|
|
2171
|
-
//#region src/ActionsProvenance.d.ts
|
|
2172
2112
|
/**
|
|
2173
2113
|
* Builds the current run's SLSA provenance from the runner's OIDC claims: the
|
|
2174
2114
|
* Actions side of `@effected/sbom`'s `SlsaProvenance.forGitHubWorkflow`.
|
|
2175
2115
|
*
|
|
2176
2116
|
* @remarks
|
|
2177
2117
|
* `SlsaProvenance.forGitHubWorkflow` is total and does the real work, but it
|
|
2178
|
-
* takes
|
|
2179
|
-
* actually holds is the runner's own OIDC claims,
|
|
2180
|
-
*
|
|
2181
|
-
* fields, so transposing `
|
|
2182
|
-
* passes every type check, and produces a
|
|
2183
|
-
* the **wrong** provenance. This module
|
|
2118
|
+
* takes an all-string input record — and the only input anyone inside a
|
|
2119
|
+
* workflow actually holds is the runner's own OIDC claims, decoded as
|
|
2120
|
+
* `@effected/github`'s `ActionsOidcClaims` with integer ids. The projection
|
|
2121
|
+
* between the two is eleven close-cousin fields, so transposing `repositoryId`
|
|
2122
|
+
* and `repositoryOwnerId` compiles, passes every type check, and produces a
|
|
2123
|
+
* validly signed attestation asserting the **wrong** provenance. This module
|
|
2124
|
+
* owns that projection once, rendering the ids back to the decimal strings the
|
|
2125
|
+
* token carried, on the same
|
|
2184
2126
|
* `github-actions` ↔ `sbom` seam as {@link ActionsIdentityToken}: `sbom` must
|
|
2185
2127
|
* not depend on the Actions runtime, so the adapter lives here, beside the
|
|
2186
2128
|
* services it reads.
|
|
@@ -2210,7 +2152,7 @@ export declare class ActionsProvenance {
|
|
|
2210
2152
|
*
|
|
2211
2153
|
* @remarks
|
|
2212
2154
|
* Every field `GitHubWorkflowProvenance` declares is populated from
|
|
2213
|
-
*
|
|
2155
|
+
* the runner's `ActionsOidcClaims`, except `serverUrl`, which is read from
|
|
2214
2156
|
* `GITHUB_SERVER_URL` through {@link ActionEnvironment}'s `getOptional`
|
|
2215
2157
|
* with `https://github.com` as the default — **not** through the
|
|
2216
2158
|
* `GitHubContext` projection. The projection fails typed when a `GITHUB_*`
|
|
@@ -2235,8 +2177,6 @@ export declare class ActionsProvenance {
|
|
|
2235
2177
|
*/
|
|
2236
2178
|
static readonly capture: (audience?: string) => Effect.Effect<SlsaProvenance, OidcTokenError, OidcTokenIssuer | ActionEnvironment>;
|
|
2237
2179
|
}
|
|
2238
|
-
//#endregion
|
|
2239
|
-
//#region src/Artifact.d.ts
|
|
2240
2180
|
declare const ArtifactError_base: Schema.Class<ArtifactError, Schema.TaggedStruct<"ArtifactError", {
|
|
2241
2181
|
/**
|
|
2242
2182
|
* `misconfigured` — the results backend is not reachable from here (see
|
|
@@ -2427,8 +2367,6 @@ export declare class Artifact extends Artifact_base {
|
|
|
2427
2367
|
/** {@link Artifact.makeTest} behind `Layer.succeed`. */
|
|
2428
2368
|
static readonly layerTest: (overrides?: Partial<ArtifactShape>) => Layer.Layer<Artifact>;
|
|
2429
2369
|
}
|
|
2430
|
-
//#endregion
|
|
2431
|
-
//#region src/BlobEnvelope.d.ts
|
|
2432
2370
|
declare const NotABlobEnvelopeError_base: Schema.Class<NotABlobEnvelopeError, Schema.TaggedStruct<"NotABlobEnvelopeError", {
|
|
2433
2371
|
/** The underlying failure, preserved structurally. */
|
|
2434
2372
|
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
@@ -2571,15 +2509,17 @@ export declare class BlobEnvelope {
|
|
|
2571
2509
|
readonly body: Uint8Array;
|
|
2572
2510
|
}, BlobEnvelopeError>;
|
|
2573
2511
|
}
|
|
2574
|
-
//#endregion
|
|
2575
|
-
//#region src/BlobStore.d.ts
|
|
2576
2512
|
declare const BlobStoreError_base: Schema.Class<BlobStoreError, Schema.TaggedStruct<"BlobStoreError", {
|
|
2577
2513
|
/**
|
|
2578
2514
|
* `unreachable` — the store could not be contacted. `refused` — it answered,
|
|
2579
2515
|
* unhappily; `status` says how. `misconfigured` — the layer was built with
|
|
2580
|
-
* settings the store cannot use
|
|
2516
|
+
* settings the store cannot use, or a request could not be signed with them
|
|
2517
|
+
* (no WebCrypto in the runtime, or key material it refuses). `invalidKey` —
|
|
2518
|
+
* the caller's key cannot be stored at all, whatever the settings: on S3, a
|
|
2519
|
+
* key with a `.` or `..` path segment, which no URL carries as signed.
|
|
2520
|
+
* Nothing is sent.
|
|
2581
2521
|
*/
|
|
2582
|
-
readonly reason: Schema.Literals<readonly ["unreachable", "refused", "misconfigured"]>;
|
|
2522
|
+
readonly reason: Schema.Literals<readonly ["unreachable", "refused", "misconfigured", "invalidKey"]>;
|
|
2583
2523
|
/** The key involved. A stable identifier, never a value. */
|
|
2584
2524
|
readonly key: Schema.optionalKey<Schema.String>;
|
|
2585
2525
|
/** The HTTP status, when the store answered. */
|
|
@@ -2694,16 +2634,23 @@ export declare class BlobStore extends BlobStore_base {
|
|
|
2694
2634
|
* An S3-compatible backend, signed with SigV4.
|
|
2695
2635
|
*
|
|
2696
2636
|
* @remarks
|
|
2697
|
-
* No `@aws-sdk/*` dependency: signing is
|
|
2698
|
-
*
|
|
2699
|
-
*
|
|
2700
|
-
*
|
|
2637
|
+
* No `@aws-sdk/*` dependency: signing is `@effected/crypto`'s `SigV4`, a
|
|
2638
|
+
* specified algorithm over strings and HMACs. The SDK's weight is in
|
|
2639
|
+
* credential management, retries and a service catalogue none of which this
|
|
2640
|
+
* needs.
|
|
2641
|
+
*
|
|
2642
|
+
* Requires core `Crypto` for the SHA-256 digests signing takes, resolved
|
|
2643
|
+
* once when the layer is built; `NodeServices.layer` supplies it. A request
|
|
2644
|
+
* that cannot be signed fails as {@link BlobStoreError} `misconfigured`. A
|
|
2645
|
+
* key with a `.` or `..` path segment fails as `invalidKey` before anything
|
|
2646
|
+
* is signed or sent: every URL parser collapses such a segment, so the store
|
|
2647
|
+
* would receive another path than the one signed.
|
|
2701
2648
|
*
|
|
2702
2649
|
* A parameterized layer factory mints a fresh layer per call and layers
|
|
2703
2650
|
* memoize by reference — bind it to a `const` rather than calling it at each
|
|
2704
2651
|
* composition site.
|
|
2705
2652
|
*/
|
|
2706
|
-
static readonly layerS3: (config: S3Config) => Layer.Layer<BlobStore, never, HttpClient.HttpClient | ActionOutputs>;
|
|
2653
|
+
static readonly layerS3: (config: S3Config) => Layer.Layer<BlobStore, never, HttpClient.HttpClient | ActionOutputs | Crypto.Crypto>;
|
|
2707
2654
|
/** A test double. Unstubbed members die rather than reporting a miss. */
|
|
2708
2655
|
static readonly makeTest: (overrides?: Partial<BlobStoreShape>) => BlobStoreShape;
|
|
2709
2656
|
/** {@link BlobStore.makeTest} behind `Layer.succeed`. */
|
|
@@ -2719,8 +2666,6 @@ export declare class BlobStore extends BlobStore_base {
|
|
|
2719
2666
|
*/
|
|
2720
2667
|
static readonly layerMemory: Layer.Layer<BlobStore>;
|
|
2721
2668
|
}
|
|
2722
|
-
//#endregion
|
|
2723
|
-
//#region src/BlobStore.githubCache.d.ts
|
|
2724
2669
|
/**
|
|
2725
2670
|
* The {@link BlobStore} backend that stores blobs in the runner's own Actions
|
|
2726
2671
|
* cache.
|
|
@@ -2781,8 +2726,6 @@ export declare class GitHubCacheBlobStore {
|
|
|
2781
2726
|
*/
|
|
2782
2727
|
static readonly layerWith: (transfer: DataBlobTransfer) => Layer.Layer<BlobStore, never, HttpClient.HttpClient | ActionEnvironment>;
|
|
2783
2728
|
}
|
|
2784
|
-
//#endregion
|
|
2785
|
-
//#region src/CheckDocument.d.ts
|
|
2786
2729
|
declare const CheckReport_base: Schema.Class<CheckReport, Schema.Struct<{
|
|
2787
2730
|
/** Where the check is now. The last reported state is the authoritative one. */
|
|
2788
2731
|
readonly state: Schema.Literals<readonly ["running", "pass", "fail", "warn", "user_interaction_required", "skipped", "timeout"]>;
|
|
@@ -3084,8 +3027,6 @@ export declare class CheckDocument extends CheckDocument_base {
|
|
|
3084
3027
|
/** {@link CheckDocument.makeTest} behind a `Layer`. */
|
|
3085
3028
|
static readonly layerTest: (overrides?: Partial<CheckDocumentShape>) => Layer.Layer<CheckDocument>;
|
|
3086
3029
|
}
|
|
3087
|
-
//#endregion
|
|
3088
|
-
//#region src/CheckState.d.ts
|
|
3089
3030
|
/**
|
|
3090
3031
|
* The kit's check-state vocabulary.
|
|
3091
3032
|
*
|
|
@@ -3154,8 +3095,6 @@ type CheckRunProjection = {
|
|
|
3154
3095
|
* @public
|
|
3155
3096
|
*/
|
|
3156
3097
|
export declare const projectCheckState: (state: CheckState) => CheckRunProjection;
|
|
3157
|
-
//#endregion
|
|
3158
|
-
//#region src/ChildEnv.d.ts
|
|
3159
3098
|
/**
|
|
3160
3099
|
* The environment additions {@link ChildEnv.prependPath} builds: exactly one
|
|
3161
3100
|
* entry, keyed by the spelling of `PATH` the base environment already uses.
|
|
@@ -3307,8 +3246,6 @@ export declare class ChildEnv {
|
|
|
3307
3246
|
*/
|
|
3308
3247
|
static needsShell(platform: string): boolean;
|
|
3309
3248
|
}
|
|
3310
|
-
//#endregion
|
|
3311
|
-
//#region src/DetachedProcess.d.ts
|
|
3312
3249
|
declare const DetachedLogUnavailableError_base: Schema.Class<DetachedLogUnavailableError, Schema.TaggedStruct<"DetachedLogUnavailableError", {
|
|
3313
3250
|
/** The log file that could not be opened. */
|
|
3314
3251
|
readonly path: Schema.String;
|
|
@@ -3645,8 +3582,6 @@ export declare class DetachedProcess {
|
|
|
3645
3582
|
*/
|
|
3646
3583
|
static readonly makeTestOps: (overrides?: Partial<DetachedProcessOps>) => DetachedProcessOps;
|
|
3647
3584
|
}
|
|
3648
|
-
//#endregion
|
|
3649
|
-
//#region src/DryRun.d.ts
|
|
3650
3585
|
/**
|
|
3651
3586
|
* The {@link DryRun} service shape.
|
|
3652
3587
|
*
|
|
@@ -3728,8 +3663,6 @@ export declare class DryRun extends DryRun_base {
|
|
|
3728
3663
|
/** {@link DryRun.makeTest} behind `Layer.succeed`. */
|
|
3729
3664
|
static readonly layerTest: (overrides?: Partial<DryRunShape>) => Layer.Layer<DryRun>;
|
|
3730
3665
|
}
|
|
3731
|
-
//#endregion
|
|
3732
|
-
//#region src/GitHubMarkdown.d.ts
|
|
3733
3666
|
/**
|
|
3734
3667
|
* A heading level GitHub renders, `1` through `6`.
|
|
3735
3668
|
*
|
|
@@ -3980,8 +3913,6 @@ export declare class GitHubMarkdown {
|
|
|
3980
3913
|
*/
|
|
3981
3914
|
static raw(markdown: string): string;
|
|
3982
3915
|
}
|
|
3983
|
-
//#endregion
|
|
3984
|
-
//#region src/GitHubToken.d.ts
|
|
3985
3916
|
declare const GitHubTokenError_base: Schema.Class<GitHubTokenError, Schema.TaggedStruct<"GitHubTokenError", {
|
|
3986
3917
|
/**
|
|
3987
3918
|
* One reason, deliberately: everything else that can go wrong here already
|
|
@@ -4169,8 +4100,6 @@ export declare class GitHubToken {
|
|
|
4169
4100
|
*/
|
|
4170
4101
|
static readonly dispose: (options?: ReadOptions | undefined) => Effect.Effect<void, ActionStateError | import("@effected/github").GitHubAppError, ActionState | GitHubApp>;
|
|
4171
4102
|
}
|
|
4172
|
-
//#endregion
|
|
4173
|
-
//#region src/ManagedDocument.d.ts
|
|
4174
4103
|
declare const ManagedDocumentError_base: Schema.Class<ManagedDocumentError, Schema.TaggedStruct<"ManagedDocumentError", {
|
|
4175
4104
|
/** Which ambiguity or refusal was found. */
|
|
4176
4105
|
readonly kind: Schema.Literals<readonly ["unterminatedRegion", "orphanedEnd", "overlappingRegions", "duplicateRegion", "markerInContent", "duplicateDeclaration", "invalidAttribute"]>;
|
|
@@ -4387,8 +4316,6 @@ export declare class ManagedDocument extends ManagedDocument_base {
|
|
|
4387
4316
|
*/
|
|
4388
4317
|
private ensureSentinel;
|
|
4389
4318
|
}
|
|
4390
|
-
//#endregion
|
|
4391
|
-
//#region src/ToolInstaller.d.ts
|
|
4392
4319
|
declare const ToolInstallerError_base: Schema.Class<ToolInstallerError, Schema.TaggedStruct<"ToolInstallerError", {
|
|
4393
4320
|
/**
|
|
4394
4321
|
* `downloadFailed` — the archive could not be fetched. `extractFailed` — the
|
|
@@ -4657,8 +4584,6 @@ export declare class ToolInstaller extends ToolInstaller_base {
|
|
|
4657
4584
|
/** {@link ToolInstaller.makeTest} behind `Layer.succeed`. */
|
|
4658
4585
|
static readonly layerTest: (overrides?: Partial<ToolInstallerShape>) => Layer.Layer<ToolInstaller>;
|
|
4659
4586
|
}
|
|
4660
|
-
//#endregion
|
|
4661
|
-
//#region src/PackageManagerInstaller.d.ts
|
|
4662
4587
|
declare const PackageManagerInstallerError_base: Schema.Class<PackageManagerInstallerError, Schema.TaggedStruct<"PackageManagerInstallerError", {
|
|
4663
4588
|
/**
|
|
4664
4589
|
* `downloadFailed`, `extractFailed` and `cacheFailed` mirror the
|
|
@@ -4961,8 +4886,6 @@ export declare class PackageManagerInstaller extends PackageManagerInstaller_bas
|
|
|
4961
4886
|
/** {@link PackageManagerInstaller.makeTest} behind `Layer.succeed`. */
|
|
4962
4887
|
static readonly layerTest: (overrides?: Partial<PackageManagerInstallerShape>) => Layer.Layer<PackageManagerInstaller>;
|
|
4963
4888
|
}
|
|
4964
|
-
//#endregion
|
|
4965
|
-
//#region src/Secret.d.ts
|
|
4966
4889
|
/**
|
|
4967
4890
|
* The declassification seam: the **only** place in this package where a
|
|
4968
4891
|
* `Redacted` value becomes a plain string.
|
|
@@ -5041,9 +4964,13 @@ export declare class Secret {
|
|
|
5041
4964
|
* Declassify one secret for an in-process use that needs the raw bytes.
|
|
5042
4965
|
*
|
|
5043
4966
|
* @remarks
|
|
5044
|
-
*
|
|
5045
|
-
*
|
|
5046
|
-
*
|
|
4967
|
+
* For a consumer that must hand the raw key to code taking a plain string,
|
|
4968
|
+
* such as a third-party signing library. A signer that takes a `Redacted`
|
|
4969
|
+
* needs no declassification at all: `@effected/crypto`'s `SigV4` and `Hmac`
|
|
4970
|
+
* unwrap the key only where they compute, so a caller of those (this
|
|
4971
|
+
* package's own S3 `BlobStore` is one) registers the value with
|
|
4972
|
+
* {@link Secret.mask} and passes the `Redacted` on. No module in this
|
|
4973
|
+
* package calls this member any more.
|
|
5047
4974
|
*
|
|
5048
4975
|
* Signing named the member; it does not gate it. **Any in-process use that
|
|
5049
4976
|
* needs the raw value without writing it to a runner file is this
|
|
@@ -5068,9 +4995,9 @@ export declare class Secret {
|
|
|
5068
4995
|
* `::add-mask::` command only masks when the runner parses this process's
|
|
5069
4996
|
* stdout; a detached worker's stdout is a log file no runner parses, so
|
|
5070
4997
|
* there the command masks nothing *and* spells the plaintext into the log.
|
|
5071
|
-
* A worker that signs
|
|
5072
|
-
*
|
|
5073
|
-
*
|
|
4998
|
+
* A worker that signs must compose `ActionOutputs.layerDetached`, under
|
|
4999
|
+
* which this member still returns the raw key but the mask is a
|
|
5000
|
+
* documented no-op; the masking
|
|
5074
5001
|
* itself is the **parent's** job, done before the spawn via
|
|
5075
5002
|
* {@link Secret.forChildEnv} under the real layer.
|
|
5076
5003
|
*/
|
|
@@ -5144,6 +5071,5 @@ export declare class Secret {
|
|
|
5144
5071
|
*/
|
|
5145
5072
|
static readonly adopt: (name: string) => Config.Config<Redacted.Redacted<string>>;
|
|
5146
5073
|
}
|
|
5147
|
-
//#endregion
|
|
5148
5074
|
export { type ActionCacheShape, type ActionEnvironmentShape, type ActionLoggerShape, type ActionOutputError, type ActionOutputsShape, type ActionRunOptions, type ActionServices, type ActionStateShape, type AnnotationProperties, type ArtifactItem, type ArtifactRef, type ArtifactShape, type BlobEnvelopeError, type BlobStoreShape, type CacheKeyError, type CheckDocumentOptions, type CheckDocumentShape, type CheckDocumentSink, type CheckFlushOutcome, type CheckRunConclusion, type CheckRunProjection, type ClientLayerOptions, type DataBlobTransfer, type DetachedProcessError, type DetachedProcessOps, type DetachedSpawnOptions, type DownloadOptions, type DownloadResult, type DryRunShape, type ExtractOptions, type FileBlobTransfer, type GitHubHeadingDepth, type GitHubListOptions, type GitHubRowSchema, type GitHubSchemaTable, type GitHubSchemaTableColumn, type GitHubSchemaTableColumns, type GitHubSchemaTableFormatRequiredKeys, type GitHubSchemaTableFormattedColumn, type GitHubSchemaTableOptions, type ManagedDocumentSource, type OidcTokenIssuerShape, type PackageManagerInstallOptions, type PackageManagerInstallerShape, type PairsOptions, type PathPrependEnv, type PathPrependOptions, type ProvisionFileOptions, type ProvisionOptions, type ProvisionedFile, type ReadOptions, type ReadinessOptions, type RecordedOutputMember, type RecordingOutputs, type S3Config, type StoredBlob, type ToolDownloadOptions, type ToolInstallerShape, type UploadOptions, type UploadResult, type WithBufferOptions, type WithStepOptions, WorkflowCommand };
|
|
5149
5075
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { ActionState, ActionStateError } from "./ActionState.js";
|
|
|
6
6
|
import { Action, ActionRuntime, describeCause } from "./Action.js";
|
|
7
7
|
import { BlobTransferError } from "./BlobTransfer.js";
|
|
8
8
|
import { ActionCache, ActionCacheError } from "./ActionCache.js";
|
|
9
|
-
import {
|
|
9
|
+
import { OidcTokenError, OidcTokenIssuer } from "./OidcTokenIssuer.js";
|
|
10
10
|
import { ActionsIdentityToken } from "./ActionsIdentityToken.js";
|
|
11
11
|
import { ActionsProvenance } from "./ActionsProvenance.js";
|
|
12
12
|
import { Artifact, ArtifactError } from "./Artifact.js";
|
|
@@ -27,4 +27,4 @@ import { ToolInstaller, ToolInstallerError } from "./ToolInstaller.js";
|
|
|
27
27
|
import { AmbientPackageManager, CachedPackageManager, InstalledPackageManager, PackageManagerInstaller, PackageManagerInstallerError } from "./PackageManagerInstaller.js";
|
|
28
28
|
import { WorkflowCommand } from "@effected/github-commands";
|
|
29
29
|
|
|
30
|
-
export { Action, ActionCache, ActionCacheError, ActionEnvironment, ActionEnvironmentError, ActionInput, ActionLogger, ActionOutputs, ActionRuntime, ActionState, ActionStateError, ActionsIdentityToken, ActionsProvenance, AmbientPackageManager, Artifact, ArtifactError, BlobEnvelope, BlobMetadataDecodeError, BlobMetadataEncodeError, BlobStore, BlobStoreError, BlobTransferError, CacheKey, CacheKeyBadPatternError, CacheKeyReadError, CachedPackageManager, CheckDocument, CheckDocumentError, CheckDocumentStamp, CheckReport, CheckState, ChildEnv, DetachedLogUnavailableError, DetachedNotReadyError, DetachedOutputError, DetachedProcess, DetachedSignalFailedError, DetachedSpawnFailedError, DryRun, GitHubCacheBlobStore, GitHubContext, GitHubMarkdown, GitHubToken, GitHubTokenError, InstalledPackageManager, InvalidOutputNameError, InvalidPidError, ManagedDocument, ManagedDocumentError, NotABlobEnvelopeError,
|
|
30
|
+
export { Action, ActionCache, ActionCacheError, ActionEnvironment, ActionEnvironmentError, ActionInput, ActionLogger, ActionOutputs, ActionRuntime, ActionState, ActionStateError, ActionsIdentityToken, ActionsProvenance, AmbientPackageManager, Artifact, ArtifactError, BlobEnvelope, BlobMetadataDecodeError, BlobMetadataEncodeError, BlobStore, BlobStoreError, BlobTransferError, CacheKey, CacheKeyBadPatternError, CacheKeyReadError, CachedPackageManager, CheckDocument, CheckDocumentError, CheckDocumentStamp, CheckReport, CheckState, ChildEnv, DetachedLogUnavailableError, DetachedNotReadyError, DetachedOutputError, DetachedProcess, DetachedSignalFailedError, DetachedSpawnFailedError, DryRun, GitHubCacheBlobStore, GitHubContext, GitHubMarkdown, GitHubToken, GitHubTokenError, InstalledPackageManager, InvalidOutputNameError, InvalidPidError, ManagedDocument, ManagedDocumentError, NotABlobEnvelopeError, OidcTokenError, OidcTokenIssuer, OutputEncodeError, PackageManagerInstaller, PackageManagerInstallerError, ProcessId, RecordedOutput, RunnerContext, RunnerFileUnavailableError, RunnerFileWriteError, Secret, ToolInstaller, ToolInstallerError, TruncatedBlobEnvelopeError, UnsupportedBlobEnvelopeVersionError, WorkflowCommand, describeCause, projectCheckState };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { payloadOf } from "./jwt.js";
|
|
2
1
|
import { Effect, Option, Redacted, Result } from "effect";
|
|
2
|
+
import { Jws } from "@effected/jwt";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/internal/actionsResults.ts
|
|
5
5
|
/** The variable naming the backend. Absent outside a `uses:` step. */
|
|
6
6
|
const RESULTS_URL = "ACTIONS_RESULTS_URL";
|
|
7
7
|
/** The variable holding the run-scoped credential. Absent outside a `uses:` step. */
|
|
@@ -26,9 +26,10 @@ const misconfiguredDetail = (variable, service) => `${variable} is not set — t
|
|
|
26
26
|
* @internal
|
|
27
27
|
*/
|
|
28
28
|
const backendIdsFrom = (token) => {
|
|
29
|
-
const
|
|
30
|
-
if (Result.isFailure(
|
|
31
|
-
const
|
|
29
|
+
const decoded = Jws.decodeUnverified(token);
|
|
30
|
+
if (Result.isFailure(decoded)) return Result.fail(`the runtime token is not a readable JWT: ${decoded.failure.detail}`);
|
|
31
|
+
const payload = decoded.success.payload;
|
|
32
|
+
const scope = typeof payload === "object" && payload !== null ? payload.scp : void 0;
|
|
32
33
|
if (typeof scope !== "string") return Result.fail("the runtime token carries no `scp` claim");
|
|
33
34
|
for (const entry of scope.split(" ")) {
|
|
34
35
|
const parts = entry.split(":");
|
|
@@ -72,5 +73,4 @@ const resultsBackend = (env) => Effect.gen(function* () {
|
|
|
72
73
|
};
|
|
73
74
|
});
|
|
74
75
|
|
|
75
|
-
//#endregion
|
|
76
76
|
export { RESULTS_URL, RUNTIME_TOKEN, backendIdsFrom, misconfiguredDetail, resultsBackend };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChildProcess } from "effect/process";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/archiveCommands.ts
|
|
4
4
|
/** A PowerShell single-quoted literal: `'` becomes `''`, nothing else is special. */
|
|
5
5
|
const pwshLiteral = (value) => `'${value.replaceAll("'", "''")}'`;
|
|
6
6
|
/** A non-interactive pwsh invocation of one command line. */
|
|
@@ -83,5 +83,4 @@ const tarExtractCommand = (options) => {
|
|
|
83
83
|
]);
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
//#endregion
|
|
87
86
|
export { tarExtractCommand, unzipCommand, zipCommand, zipManifest };
|
package/internal/cacheService.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CONFLICT, isOk, stringField } from "./twirp.js";
|
|
2
2
|
import { Effect, Option } from "effect";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/internal/cacheService.ts
|
|
5
5
|
/** The Twirp service the Actions cache protocol lives under. @internal */
|
|
6
6
|
const CACHE_SERVICE = "github.actions.results.api.v1.CacheService";
|
|
7
7
|
/**
|
|
@@ -50,5 +50,4 @@ const lookupDownload = (client, key, restoreKeys, version) => Effect.map(client.
|
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
//#endregion
|
|
54
53
|
export { CACHE_SERVICE, finalizeUpload, lookupDownload, reserveUpload };
|
package/internal/digest.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Effect, Stream } from "effect";
|
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import * as Hex from "effect/encoding/Hex";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/internal/digest.ts
|
|
6
6
|
/** The raw SHA-256 of a string or byte array held in memory. @internal */
|
|
7
7
|
const sha256 = (value) => new Uint8Array(createHash("sha256").update(value).digest());
|
|
8
8
|
/** The hex SHA-256 of a string or byte array held in memory. @internal */
|
|
@@ -27,5 +27,4 @@ const digestFile = (fs, file, algorithm) => Effect.suspend(() => {
|
|
|
27
27
|
/** {@link digestFile}, as hex. @internal */
|
|
28
28
|
const digestFileHex = (fs, file, algorithm) => Effect.map(digestFile(fs, file, algorithm), Hex.encode);
|
|
29
29
|
|
|
30
|
-
//#endregion
|
|
31
30
|
export { digestFile, digestFileHex, sha256, sha256Hex };
|
package/internal/fsProbe.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/fsProbe.ts
|
|
4
4
|
/**
|
|
5
5
|
* The entry's type, or `undefined` when nothing readable is there. Absence
|
|
6
6
|
* and unreadability collapse together on purpose: every caller's next move
|
|
@@ -18,5 +18,4 @@ const typeAt = (fs, path) => Effect.map(Effect.option(fs.stat(path)), (info) =>
|
|
|
18
18
|
*/
|
|
19
19
|
const isErrno = (cause, code) => typeof cause === "object" && cause !== null && cause.code === code;
|
|
20
20
|
|
|
21
|
-
//#endregion
|
|
22
21
|
export { isErrno, typeAt };
|
package/internal/json.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
|
|
3
|
+
// src/internal/json.ts
|
|
4
|
+
/**
|
|
5
|
+
* Parse JSON text to an unknown value, failing with a `SchemaError` on text that is not JSON.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
const decodeJson = Schema.decodeUnknownEffect(Schema.fromJsonString(Schema.Unknown));
|
|
10
|
+
|
|
11
|
+
export { decodeJson };
|
package/internal/pnpmExe.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Option, Result } from "effect";
|
|
|
2
2
|
import * as Hex from "effect/encoding/Hex";
|
|
3
3
|
import * as Base64 from "effect/encoding/Base64";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/internal/pnpmExe.ts
|
|
6
6
|
/** The prefix every native-binary package name carries. @internal */
|
|
7
7
|
const PNPM_EXE_PREFIX = "@pnpm/exe.";
|
|
8
8
|
/**
|
|
@@ -107,5 +107,4 @@ const strongestSri = (integrity) => {
|
|
|
107
107
|
/** Whether a bin target is a Node script (run with `node`) rather than an executable run directly. @internal */
|
|
108
108
|
const isNodeScript = (target) => /\.[cm]?js$/i.test(target);
|
|
109
109
|
|
|
110
|
-
//#endregion
|
|
111
110
|
export { PNPM_EXE_PREFIX, detectMusl, isNodeScript, pnpmExeTarget, strongestSri };
|
package/internal/runner.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Option } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/runner.ts
|
|
4
4
|
/**
|
|
5
5
|
* Whether `RUNNER_OS` says Windows. `false` when unset — off a runner, the
|
|
6
6
|
* POSIX shape is the honest default.
|
|
@@ -26,6 +26,25 @@ const isWindowsRunner = (env) => Effect.map(env.getOptional("RUNNER_OS"), (found
|
|
|
26
26
|
* @internal
|
|
27
27
|
*/
|
|
28
28
|
const toolCacheRoot = (env, path) => Effect.map(env.getOptional("RUNNER_TOOL_CACHE"), (found) => Option.getOrElse(found, () => path.join("/tmp", "runner-tool-cache")));
|
|
29
|
+
/** `RUNNER_ARCH`'s spellings (`X86`, `X64`, `ARM`, `ARM64`), lower-cased, in Node's `process.arch` spelling. */
|
|
30
|
+
const NODE_ARCH = /* @__PURE__ */ new Map([
|
|
31
|
+
["x86", "ia32"],
|
|
32
|
+
["x64", "x64"],
|
|
33
|
+
["arm", "arm"],
|
|
34
|
+
["arm64", "arm64"]
|
|
35
|
+
]);
|
|
36
|
+
/** A `RUNNER_ARCH` value in Node's spelling; anything unrecognised passes through. */
|
|
37
|
+
const archFromRunner = (runnerArch) => NODE_ARCH.get(runnerArch.toLowerCase()) ?? runnerArch;
|
|
38
|
+
/**
|
|
39
|
+
* The host architecture in Node's spelling: `RUNNER_ARCH` mapped through
|
|
40
|
+
* `archFromRunner`, or `process.arch` off a runner, where the variable is
|
|
41
|
+
* absent and the host's own answer is the honest fallback.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
const runnerArch = (env) => Effect.map(env.getOptional("RUNNER_ARCH"), (found) => Option.match(found, {
|
|
46
|
+
onNone: () => process.arch,
|
|
47
|
+
onSome: archFromRunner
|
|
48
|
+
}));
|
|
29
49
|
|
|
30
|
-
|
|
31
|
-
export { isWindowsRunner, toolCacheRoot };
|
|
50
|
+
export { isWindowsRunner, runnerArch, toolCacheRoot };
|
package/internal/runnerFile.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/runnerFile.ts
|
|
2
2
|
/** The base delimiter for a heredoc block. */
|
|
3
3
|
const BASE_DELIMITER = "EFFECTED_EOF";
|
|
4
4
|
/** A delimiter guaranteed absent from `value`. @internal */
|
|
@@ -44,5 +44,4 @@ const heredocBlock = (name, value) => {
|
|
|
44
44
|
return `${name}<<${delimiter}\n${value}\n${delimiter}\n`;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
//#endregion
|
|
48
47
|
export { delimiterFor, heredocBlock, isUsableName };
|
package/internal/shim.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isNodeScript } from "./pnpmExe.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/shim.ts
|
|
4
4
|
/**
|
|
5
5
|
* The POSIX shim body: an `exec` wrapper so the shim's process *becomes* the
|
|
6
6
|
* target, and `"$@"` so arguments survive quoting intact. A Node script
|
|
@@ -26,5 +26,4 @@ const cmdShim = (target) => isNodeScript(target) ? `@echo off\r\nnode "${target}
|
|
|
26
26
|
*/
|
|
27
27
|
const gitBashShim = (target) => posixShim(target.replaceAll("\\", "/"));
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { cmdShim, gitBashShim, posixShim };
|