@effected/github-actions 0.31.0 → 0.32.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 +7 -6
- package/ActionInput.js +7 -2
- package/README.md +1 -1
- package/index.d.ts +15 -9
- package/package.json +10 -10
package/Action.js
CHANGED
|
@@ -33,17 +33,18 @@ var ActionRuntime = class {
|
|
|
33
33
|
* and the workflow-command `Logger`.
|
|
34
34
|
*
|
|
35
35
|
* @remarks
|
|
36
|
-
* The platform is `NodeServices.layer` plus Node's `Digest`, `Mac
|
|
37
|
-
* `SecureRandom` crypto layers (`NodeCrypto.layerDigest`,
|
|
38
|
-
* `NodeCrypto.layerMac
|
|
39
|
-
* `NodeServices.layer` does not carry;
|
|
40
|
-
* digests and HMACs from them
|
|
36
|
+
* The platform is `NodeServices.layer` plus Node's `Digest`, `Mac`,
|
|
37
|
+
* `SecureRandom` and `Signature` crypto layers (`NodeCrypto.layerDigest`,
|
|
38
|
+
* `NodeCrypto.layerMac`, `NodeCrypto.layerSecureRandom` and
|
|
39
|
+
* `NodeCrypto.layerSignature`), which `NodeServices.layer` does not carry;
|
|
40
|
+
* `BlobStore.layerS3` takes its digests and HMACs from them, and
|
|
41
|
+
* `GitHubApp.layer` signs its app JWT with `Signature`.
|
|
41
42
|
*
|
|
42
43
|
* A bound constant rather than a factory. A layer-returning function mints a
|
|
43
44
|
* fresh layer per call, and layers memoize by reference — a factory here
|
|
44
45
|
* would rebuild the environment snapshot for every composition site.
|
|
45
46
|
*/
|
|
46
|
-
static layer = Layer.mergeAll(ActionLogger.layer, ActionLogger.layerLogger, ActionState.layer, ActionInput.layerDefault).pipe(Layer.provideMerge(ActionOutputs.layer), Layer.provideMerge(ActionEnvironment.layer), Layer.provideMerge(Layer.mergeAll(NodeServices.layer, NodeCrypto.layerDigest, NodeCrypto.layerMac, NodeCrypto.layerSecureRandom, FetchHttpClient.layer)));
|
|
47
|
+
static layer = Layer.mergeAll(ActionLogger.layer, ActionLogger.layerLogger, ActionState.layer, ActionInput.layerDefault).pipe(Layer.provideMerge(ActionOutputs.layer), Layer.provideMerge(ActionEnvironment.layer), Layer.provideMerge(Layer.mergeAll(NodeServices.layer, NodeCrypto.layerDigest, NodeCrypto.layerMac, NodeCrypto.layerSecureRandom, NodeCrypto.layerSignature, FetchHttpClient.layer)));
|
|
47
48
|
};
|
|
48
49
|
/**
|
|
49
50
|
* Lower the minimum log level to `Debug` for the program when the runner has
|
package/ActionInput.js
CHANGED
|
@@ -337,9 +337,14 @@ var ActionInput = class ActionInput {
|
|
|
337
337
|
* yields `Config<Option<A>>` with missing → `None` and a malformed value
|
|
338
338
|
* still failing — core's `Config.option` lets validation errors propagate,
|
|
339
339
|
* which is exactly the missing-versus-malformed split above.
|
|
340
|
+
*
|
|
341
|
+
* `options` is forwarded to the decode unchanged, so
|
|
342
|
+
* `{ onExcessProperty: "error" }` rejects keys the schema does not name
|
|
343
|
+
* (they are ignored by default). The failure message itself is not
|
|
344
|
+
* customizable.
|
|
340
345
|
*/
|
|
341
|
-
static schema(name, schema) {
|
|
342
|
-
return Config.String(inputVariable(name)).pipe(Config.mapEffect((raw) => decodeJson(raw).pipe(Effect.mapError((cause) => configError(`Input "${name}" is not valid JSON`, raw, cause)), Effect.flatMap((parsed) => Schema.decodeUnknownEffect(schema)(parsed).pipe(Effect.mapError((cause) => configError(`Input "${name}" did not satisfy its schema`, parsed, cause)))))));
|
|
346
|
+
static schema(name, schema, options) {
|
|
347
|
+
return Config.String(inputVariable(name)).pipe(Config.mapEffect((raw) => decodeJson(raw).pipe(Effect.mapError((cause) => configError(`Input "${name}" is not valid JSON`, raw, cause)), Effect.flatMap((parsed) => Schema.decodeUnknownEffect(schema, options)(parsed).pipe(Effect.mapError((cause) => configError(`Input "${name}" did not satisfy its schema`, parsed, cause)))))));
|
|
343
348
|
}
|
|
344
349
|
/**
|
|
345
350
|
* A `ConfigProvider` over a record of runner variables **or input names**.
|
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ await Action.run(program);
|
|
|
57
57
|
// exit code reflects success/failure; failures render as an ::error:: annotation
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
`Action.run` provides `ActionServices` (environment, logger, outputs, state, the Node platform
|
|
60
|
+
`Action.run` provides `ActionServices` (environment, logger, outputs, state, the Node platform, an `HttpClient` and the `Digest`, `Mac`, `SecureRandom` and `Signature` crypto services) by default. A capability with a heavier dependency — the cache, artifacts, the blob store — is one extra line: `Action.run(program, { layer: ActionCache.layer })`.
|
|
61
61
|
|
|
62
62
|
Step debugging works without wiring: when the runner sets `RUNNER_DEBUG=1`, `Action.run` lowers Effect's minimum log level to `Debug`, so `Effect.logDebug` calls show up as `::debug::` lines. It only ever lowers the level; pass `{ stepDebugLogLevel: false }` to keep it as it is.
|
|
63
63
|
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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";
|
|
4
|
-
import { Digest, Mac, SecureRandom } from "effect/crypto";
|
|
3
|
+
import { Cause, Config, ConfigProvider, Context, Duration, Effect, FileSystem, Layer, Logger, Option, Path, Redacted, Result, Schema, SchemaAST } from "effect";
|
|
4
|
+
import { Digest, Mac, SecureRandom, Signature } from "effect/crypto";
|
|
5
5
|
import { HttpClient } from "effect/http";
|
|
6
6
|
import { ChildProcessSpawner } from "effect/process";
|
|
7
7
|
import { IdentityToken } from "@effected/oidc";
|
|
@@ -910,7 +910,7 @@ export declare class ActionState extends ActionState_base {
|
|
|
910
910
|
*
|
|
911
911
|
* @public
|
|
912
912
|
*/
|
|
913
|
-
type ActionServices = ActionEnvironment | ActionLogger | ActionOutputs | ActionState | NodeServices.NodeServices | Digest.Digest | Mac.Mac | SecureRandom.SecureRandom | HttpClient.HttpClient;
|
|
913
|
+
type ActionServices = ActionEnvironment | ActionLogger | ActionOutputs | ActionState | NodeServices.NodeServices | Digest.Digest | Mac.Mac | SecureRandom.SecureRandom | Signature.Signature | HttpClient.HttpClient;
|
|
914
914
|
/**
|
|
915
915
|
* The default runtime an action executes inside.
|
|
916
916
|
*
|
|
@@ -935,11 +935,12 @@ export declare class ActionRuntime {
|
|
|
935
935
|
* and the workflow-command `Logger`.
|
|
936
936
|
*
|
|
937
937
|
* @remarks
|
|
938
|
-
* The platform is `NodeServices.layer` plus Node's `Digest`, `Mac
|
|
939
|
-
* `SecureRandom` crypto layers (`NodeCrypto.layerDigest`,
|
|
940
|
-
* `NodeCrypto.layerMac
|
|
941
|
-
* `NodeServices.layer` does not carry;
|
|
942
|
-
* digests and HMACs from them
|
|
938
|
+
* The platform is `NodeServices.layer` plus Node's `Digest`, `Mac`,
|
|
939
|
+
* `SecureRandom` and `Signature` crypto layers (`NodeCrypto.layerDigest`,
|
|
940
|
+
* `NodeCrypto.layerMac`, `NodeCrypto.layerSecureRandom` and
|
|
941
|
+
* `NodeCrypto.layerSignature`), which `NodeServices.layer` does not carry;
|
|
942
|
+
* `BlobStore.layerS3` takes its digests and HMACs from them, and
|
|
943
|
+
* `GitHubApp.layer` signs its app JWT with `Signature`.
|
|
943
944
|
*
|
|
944
945
|
* A bound constant rather than a factory. A layer-returning function mints a
|
|
945
946
|
* fresh layer per call, and layers memoize by reference — a factory here
|
|
@@ -1872,8 +1873,13 @@ export declare class ActionInput {
|
|
|
1872
1873
|
* yields `Config<Option<A>>` with missing → `None` and a malformed value
|
|
1873
1874
|
* still failing — core's `Config.option` lets validation errors propagate,
|
|
1874
1875
|
* which is exactly the missing-versus-malformed split above.
|
|
1876
|
+
*
|
|
1877
|
+
* `options` is forwarded to the decode unchanged, so
|
|
1878
|
+
* `{ onExcessProperty: "error" }` rejects keys the schema does not name
|
|
1879
|
+
* (they are ignored by default). The failure message itself is not
|
|
1880
|
+
* customizable.
|
|
1875
1881
|
*/
|
|
1876
|
-
static schema<A, I>(name: string, schema: Schema.Codec<A, I
|
|
1882
|
+
static schema<A, I>(name: string, schema: Schema.Codec<A, I>, options?: SchemaAST.ParseOptions): Config.Config<A>;
|
|
1877
1883
|
/**
|
|
1878
1884
|
* A `ConfigProvider` over a record of runner variables **or input names**.
|
|
1879
1885
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effected/github-actions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.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": [
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@azure/storage-blob": "^12.33.0",
|
|
42
42
|
"@effected/crypto": "^0.5.0",
|
|
43
|
-
"@effected/github": "^0.
|
|
43
|
+
"@effected/github": "^0.29.0",
|
|
44
44
|
"@effected/github-commands": "^0.9.0",
|
|
45
|
-
"@effected/glob": "^0.
|
|
45
|
+
"@effected/glob": "^0.19.0",
|
|
46
46
|
"@effected/jwt": "^0.9.0",
|
|
47
|
-
"@effected/markdown": "^0.
|
|
48
|
-
"@effected/npm": "^0.30.
|
|
47
|
+
"@effected/markdown": "^0.27.0",
|
|
48
|
+
"@effected/npm": "^0.30.1",
|
|
49
49
|
"@effected/oidc": "^0.4.0",
|
|
50
|
-
"@effected/sbom": "^0.20.
|
|
51
|
-
"@effected/semver": "^0.
|
|
52
|
-
"@effected/templates": "^0.
|
|
53
|
-
"@effected/walker": "^0.25.
|
|
54
|
-
"@effected/yaml": "^0.
|
|
50
|
+
"@effected/sbom": "^0.20.1",
|
|
51
|
+
"@effected/semver": "^0.22.0",
|
|
52
|
+
"@effected/templates": "^0.18.0",
|
|
53
|
+
"@effected/walker": "^0.25.1",
|
|
54
|
+
"@effected/yaml": "^0.29.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@effect/platform-node": "~4.1.0",
|