@intentius/chant-lexicon-github 0.49.0 → 0.50.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/dist/components/generate-op-pipeline.d.ts +81 -0
- package/dist/components/generate-op-pipeline.d.ts.map +1 -0
- package/dist/integrity.json +15 -5
- package/dist/lint/audit-catalog.d.ts.map +1 -1
- package/dist/lint/post-synth/gha059.d.ts +40 -0
- package/dist/lint/post-synth/gha059.d.ts.map +1 -0
- package/dist/lint/post-synth/gha060.d.ts +34 -0
- package/dist/lint/post-synth/gha060.d.ts.map +1 -0
- package/dist/lint/post-synth/gha061.d.ts +27 -0
- package/dist/lint/post-synth/gha061.d.ts.map +1 -0
- package/dist/lint/post-synth/gha062.d.ts +24 -0
- package/dist/lint/post-synth/gha062.d.ts.map +1 -0
- package/dist/lint/post-synth/gha063.d.ts +12 -0
- package/dist/lint/post-synth/gha063.d.ts.map +1 -0
- package/dist/lint/post-synth/gha064.d.ts +12 -0
- package/dist/lint/post-synth/gha064.d.ts.map +1 -0
- package/dist/lint/post-synth/gha065.d.ts +19 -0
- package/dist/lint/post-synth/gha065.d.ts.map +1 -0
- package/dist/lint/post-synth/gha066.d.ts +12 -0
- package/dist/lint/post-synth/gha066.d.ts.map +1 -0
- package/dist/lint/post-synth/gha067.d.ts +12 -0
- package/dist/lint/post-synth/gha067.d.ts.map +1 -0
- package/dist/lint/post-synth/gha068.d.ts +13 -0
- package/dist/lint/post-synth/gha068.d.ts.map +1 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/lint/post-synth/yaml-helpers.d.ts +20 -0
- package/dist/lint/post-synth/yaml-helpers.d.ts.map +1 -1
- package/dist/lint/rules/data/action-usage-policy.d.ts +30 -0
- package/dist/lint/rules/data/action-usage-policy.d.ts.map +1 -0
- package/dist/lint/rules/data/advisory-feed.d.ts +36 -0
- package/dist/lint/rules/data/advisory-feed.d.ts.map +1 -0
- package/dist/manifest.json +109 -1
- package/dist/meta.json +5 -0
- package/dist/okf/index.md +10 -0
- package/dist/okf/rules/GHA059.md +15 -0
- package/dist/okf/rules/GHA060.md +15 -0
- package/dist/okf/rules/GHA061.md +15 -0
- package/dist/okf/rules/GHA062.md +15 -0
- package/dist/okf/rules/GHA063.md +15 -0
- package/dist/okf/rules/GHA064.md +15 -0
- package/dist/okf/rules/GHA065.md +15 -0
- package/dist/okf/rules/GHA066.md +15 -0
- package/dist/okf/rules/GHA067.md +15 -0
- package/dist/okf/rules/GHA068.md +15 -0
- package/dist/okf/types/Job.md +9 -0
- package/dist/okf/types/Workflow.md +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/rules/gha059.ts +132 -0
- package/dist/rules/gha060.ts +146 -0
- package/dist/rules/gha061.ts +85 -0
- package/dist/rules/gha062.ts +68 -0
- package/dist/rules/gha063.ts +60 -0
- package/dist/rules/gha064.ts +55 -0
- package/dist/rules/gha065.ts +129 -0
- package/dist/rules/gha066.ts +47 -0
- package/dist/rules/gha067.ts +76 -0
- package/dist/rules/gha068.ts +51 -0
- package/dist/rules/yaml-helpers.ts +37 -2
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -2
- package/src/codegen/docs.ts +1 -1
- package/src/components/generate-op-pipeline.test.ts +146 -0
- package/src/components/generate-op-pipeline.ts +183 -0
- package/src/generated/index.d.ts +1 -0
- package/src/generated/lexicon-github.json +5 -0
- package/src/lint/audit-catalog.ts +16 -1
- package/src/lint/post-synth/gha059.test.ts +147 -0
- package/src/lint/post-synth/gha059.ts +132 -0
- package/src/lint/post-synth/gha060.test.ts +144 -0
- package/src/lint/post-synth/gha060.ts +146 -0
- package/src/lint/post-synth/gha061.test.ts +85 -0
- package/src/lint/post-synth/gha061.ts +85 -0
- package/src/lint/post-synth/gha062.test.ts +88 -0
- package/src/lint/post-synth/gha062.ts +68 -0
- package/src/lint/post-synth/gha063.test.ts +86 -0
- package/src/lint/post-synth/gha063.ts +60 -0
- package/src/lint/post-synth/gha064.test.ts +73 -0
- package/src/lint/post-synth/gha064.ts +55 -0
- package/src/lint/post-synth/gha065.test.ts +85 -0
- package/src/lint/post-synth/gha065.ts +129 -0
- package/src/lint/post-synth/gha066.test.ts +66 -0
- package/src/lint/post-synth/gha066.ts +47 -0
- package/src/lint/post-synth/gha067.test.ts +85 -0
- package/src/lint/post-synth/gha067.ts +76 -0
- package/src/lint/post-synth/gha068.test.ts +71 -0
- package/src/lint/post-synth/gha068.ts +51 -0
- package/src/lint/post-synth/index.ts +20 -0
- package/src/lint/post-synth/yaml-helpers.ts +37 -2
- package/src/lint/rules/data/action-usage-policy.ts +31 -0
- package/src/lint/rules/data/advisory-feed.ts +38 -0
- package/src/plugin.test.ts +24 -3
- package/src/plugin.ts +28 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate mode — scheduled Op → GitHub Actions workflow YAML (#927).
|
|
3
|
+
*
|
|
4
|
+
* The Op counterpart to `./generate-pipeline.ts` (#891): that module
|
|
5
|
+
* synthesizes a `workflow_dispatch`-triggered pipeline from a deploy-time
|
|
6
|
+
* component graph, this one synthesizes a cron-triggered workflow per
|
|
7
|
+
* stateless Op — the CI-native alternative to a Temporal `TemporalSchedule`
|
|
8
|
+
* for downstream projects that don't run Temporal (`WorkflowAuditOp`,
|
|
9
|
+
* `PipelineAuditOp`, `ReconcileOp`, … all accept an optional `schedule`
|
|
10
|
+
* precisely for this).
|
|
11
|
+
*
|
|
12
|
+
* GitHub Actions' `on.schedule` is workflow-scoped, not job-scoped, so unlike
|
|
13
|
+
* the component generator (one combined pipeline for the whole graph) this
|
|
14
|
+
* emits one workflow file per `ScheduledOpSpec`. Each workflow:
|
|
15
|
+
* - triggers on `schedule` (the Op's cron) and `workflow_dispatch` (manual
|
|
16
|
+
* runs stay available for testing/dry-runs);
|
|
17
|
+
* - declares only the `permissions:` its `findingMode` needs — `report`
|
|
18
|
+
* stays read-only, `issue`/`pull-request` add the write scope the Op's own
|
|
19
|
+
* activity uses (`gh issue create` / `gh pr create`, see
|
|
20
|
+
* `@intentius/chant-lexicon-temporal`'s `reconcilePr` activity) — never a
|
|
21
|
+
* blanket `write-all`;
|
|
22
|
+
* - runs exactly one invocation, `chant run <name>` by default — never
|
|
23
|
+
* inlined audit/reconcile logic. The finding-mode itself is already baked
|
|
24
|
+
* into the Op's own activity args at build time by the composite that
|
|
25
|
+
* created it; this workflow only supplies the token the mode needs to act.
|
|
26
|
+
*/
|
|
27
|
+
import type { ComponentPipelineOptions as GenerateGithubOpOptions, OpPipelineJob, OpPipelineResult as GenerateGithubOpResult, ScheduledOpSpec } from "@intentius/chant/lexicon";
|
|
28
|
+
export type { GenerateGithubOpOptions, GenerateGithubOpResult };
|
|
29
|
+
/**
|
|
30
|
+
* The structured pipeline document behind one generated file, before YAML
|
|
31
|
+
* emission — exposed so a GitHub-Actions dialect (the forgejo lexicon, #969)
|
|
32
|
+
* can reuse the exact trigger/concurrency/job structure and only apply its
|
|
33
|
+
* dialect transform + emit, rather than re-deriving it. Mirrors
|
|
34
|
+
* `./generate-pipeline.ts`'s `GithubPipelineDoc` split.
|
|
35
|
+
*/
|
|
36
|
+
export interface GithubOpPipelineDoc {
|
|
37
|
+
/** The `on:` trigger mapping (`schedule` + `workflow_dispatch`). */
|
|
38
|
+
on: Record<string, unknown>;
|
|
39
|
+
/** The `env:` mapping, when `options.variables` is set. */
|
|
40
|
+
env?: Record<string, unknown>;
|
|
41
|
+
/** The `concurrency:` mapping — one run at a time per Op. */
|
|
42
|
+
concurrency: Record<string, unknown>;
|
|
43
|
+
/**
|
|
44
|
+
* The `permissions:` mapping for this Op's finding-mode. GitHub-only:
|
|
45
|
+
* Forgejo Actions ignores `permissions:` entirely, so the forgejo dialect
|
|
46
|
+
* drops this section rather than translating it (see ../../forgejo/src/dialect.ts).
|
|
47
|
+
*/
|
|
48
|
+
permissions: Record<string, unknown>;
|
|
49
|
+
/** The `jobs:` mapping — one entry, this Op's trigger job. */
|
|
50
|
+
jobsDoc: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
/** One generated file: a suggested name plus its pipeline document, pre-emission. */
|
|
53
|
+
export interface GithubOpPipelineFile {
|
|
54
|
+
/** Suggested file name (`<op-name>.yml`), relative to the provider's workflow directory. */
|
|
55
|
+
name: string;
|
|
56
|
+
doc: GithubOpPipelineDoc;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Build one `GithubOpPipelineDoc` per scheduled Op: cron trigger,
|
|
60
|
+
* least-privilege `permissions:` for its finding-mode, one job that runs
|
|
61
|
+
* `chant run <name>`. Throws nothing — every `ScheduledOpSpec` is independent,
|
|
62
|
+
* unlike the component generator there is no shared graph to resolve.
|
|
63
|
+
*/
|
|
64
|
+
export declare function buildGithubOpPipelineDocs(ops: ScheduledOpSpec[], options?: GenerateGithubOpOptions): {
|
|
65
|
+
files: GithubOpPipelineFile[];
|
|
66
|
+
jobs: OpPipelineJob[];
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Emit a `GithubOpPipelineDoc`'s `on`/`env`/`concurrency`/`permissions`/`jobs`
|
|
70
|
+
* mappings as workflow YAML. Shared with the forgejo dialect (#969), which
|
|
71
|
+
* transforms the doc first (and drops `permissions`, which it ignores).
|
|
72
|
+
*/
|
|
73
|
+
export declare function emitOpPipelineYAML(doc: GithubOpPipelineDoc): string;
|
|
74
|
+
/**
|
|
75
|
+
* Synthesize one `.github/workflows/*.yml` per scheduled Op. Thin wrapper
|
|
76
|
+
* over {@link buildGithubOpPipelineDocs} + {@link emitOpPipelineYAML}. Wired
|
|
77
|
+
* into core's Op generate mode via the github lexicon plugin's
|
|
78
|
+
* `generateOpPipeline` (../plugin.ts).
|
|
79
|
+
*/
|
|
80
|
+
export declare function generateGithubOpPipeline(ops: ScheduledOpSpec[], options?: GenerateGithubOpOptions): GenerateGithubOpResult;
|
|
81
|
+
//# sourceMappingURL=generate-op-pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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AAsB,CAMxB"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
5
|
-
"meta.json": "
|
|
6
|
-
"types/index.d.ts": "
|
|
4
|
+
"manifest.json": "dd3f2642674d5dd1332b56eba93ee6c55c403fd39aff3c532890ef1b67d47e54",
|
|
5
|
+
"meta.json": "e891b1214d530fd676172e3f7e0734995b9f839b7659eb2d53f43ffc97dcd21b",
|
|
6
|
+
"types/index.d.ts": "7eab3c62c76bff65d68765609e9b6151844a1f581b0c648d0eda779b4252adaf",
|
|
7
7
|
"rules/deprecated-action-version.ts": "d41e6e532ab7f623af1bee4ac5279fcb2baada7defa1c5d022a5bc71983e8797",
|
|
8
8
|
"rules/detect-secrets.ts": "5829832eb7b43993424971041ed386b196850183bffd34bddd6439f99061e4ae",
|
|
9
9
|
"rules/extract-inline-structs.ts": "8f8147c200de8ffd0620dfdcca2e2cea76a520303ce431479ebecad6aa26aab5",
|
|
@@ -62,10 +62,20 @@
|
|
|
62
62
|
"rules/gha056.ts": "73fa2eea80504522cb53db1e48b36e97ede0eeb7b60ed531a476d2f43d3746ae",
|
|
63
63
|
"rules/gha057.ts": "78e896232d6f5c3e4c1bab873eae97960dbb8a0c108f1546f32d943aafc41a91",
|
|
64
64
|
"rules/gha058.ts": "cdcb60916e3ce091b0e6c73295f24b77fca1480fb0a5907ae6d1fc5b1805f794",
|
|
65
|
-
"rules/
|
|
65
|
+
"rules/gha059.ts": "93644805955abb54e8efc567b606f233806ce9f80406df81195d5047a957c35e",
|
|
66
|
+
"rules/gha060.ts": "8049e27b6aa0ab3fa71db8f400bb7bdfe9eab3bc9a69c6f917266cae606718a8",
|
|
67
|
+
"rules/gha061.ts": "6e4da64dce2f26cd3ffece0a79c99d15bb9e7cb0504979db018e73c39074fe9a",
|
|
68
|
+
"rules/gha062.ts": "7cfcdc7728db31b52c0d150f091f0cfae127729975fad156dc93049adb99265a",
|
|
69
|
+
"rules/gha063.ts": "97ab181e987b02be4c3afb03ba7afb8a9ac27702c42ec0f863121b64d371fee5",
|
|
70
|
+
"rules/gha064.ts": "a978ee4f05c178ac182a2498f7da986159588e7e72facfd69c6b390a11ea49d5",
|
|
71
|
+
"rules/gha065.ts": "506c43f5b0f81dc8b56d629e470c7263009d9b3786fb3589189ca94219346e8e",
|
|
72
|
+
"rules/gha066.ts": "89b2c0aa127b1d5d6054fc118390662af2ec4e8d3552afe0ea1e75533cc178c0",
|
|
73
|
+
"rules/gha067.ts": "6a9ad2208759f8e7146a8af35227a9362d6aa6b16ee7bb9f7167d3d567524099",
|
|
74
|
+
"rules/gha068.ts": "e23210bc762641de044380677016afb601721a133322544733fd058bb84930ad",
|
|
75
|
+
"rules/yaml-helpers.ts": "228b4ac9384444acfc711932b5711c299eda6716472b3edd8c52635f37e6b429",
|
|
66
76
|
"skills/chant-github.md": "f3707f09634be4bbb45a6be279f17bb27f275b98e6d3337cc8872c1623ba050f",
|
|
67
77
|
"skills/chant-github-patterns.md": "bb3abef289a8fdfcf07d6bb2d7289dcb2f38bc0cb0321ea320b78b45a6f548c0",
|
|
68
78
|
"skills/chant-github-security.md": "aab111cb0871cad30281ce48d7da23663689619351029219e2be019a1a61e394"
|
|
69
79
|
},
|
|
70
|
-
"composite": "
|
|
80
|
+
"composite": "688d3295fb3d0fb8f6e232665247680c6799b9cb5d5fabb5cbe8cb19351074f4"
|
|
71
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAA4H,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAEzL,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CA6DvD,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GHA059: Stale or Missing Pin Annotation
|
|
3
|
+
*
|
|
4
|
+
* A ref pinned to a commit SHA is only as trustworthy as the label a reviewer
|
|
5
|
+
* reads next to it — `uses: actions/setup-node@1a2b…9a0b # v4.0.2` lets a
|
|
6
|
+
* reviewer sanity-check the digest without resolving it themselves. This check
|
|
7
|
+
* flags two ways that label goes stale:
|
|
8
|
+
*
|
|
9
|
+
* 1. Missing — a SHA-pinned ref with no trailing version comment at all.
|
|
10
|
+
* 2. Mismatched — inferred without any network call, from internal
|
|
11
|
+
* inconsistency in the workflow itself: the same action is pinned to the
|
|
12
|
+
* same commit SHA in one place and a *different* label in another, or the
|
|
13
|
+
* same label is attached to two *different* commit SHAs. Either shape
|
|
14
|
+
* proves at least one of the labels is wrong — a real digest has exactly
|
|
15
|
+
* one correct human-readable name.
|
|
16
|
+
*
|
|
17
|
+
* Cross-referencing a label against the actual git history (to catch a lone,
|
|
18
|
+
* internally-consistent but still-wrong annotation) needs a network call and
|
|
19
|
+
* is out of scope here — see GHA062 for the feed-based advisory check, which
|
|
20
|
+
* takes the same "no network in the rule itself" stance via an injected feed.
|
|
21
|
+
*/
|
|
22
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
23
|
+
export interface StalePinFinding {
|
|
24
|
+
job: string;
|
|
25
|
+
ref: string;
|
|
26
|
+
slug: string;
|
|
27
|
+
sha: string;
|
|
28
|
+
kind: "missing" | "mismatched";
|
|
29
|
+
/** For "mismatched": the other label/SHA this one conflicts with. */
|
|
30
|
+
conflict?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Find every SHA-pinned `uses:` with a missing or internally-inconsistent
|
|
34
|
+
* version annotation. Scoped to one workflow document — cross-file
|
|
35
|
+
* consistency isn't attempted since two independent workflows pinning the
|
|
36
|
+
* same action differently isn't evidence of drift.
|
|
37
|
+
*/
|
|
38
|
+
export declare function findStalePinAnnotations(yaml: string): StalePinFinding[];
|
|
39
|
+
export declare const gha059: PostSynthCheck;
|
|
40
|
+
//# sourceMappingURL=gha059.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gha059.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/gha059.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAK9G,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,SAAS,GAAG,YAAY,CAAC;IAC/B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,EAAE,CA4DvE;AAED,eAAO,MAAM,MAAM,EAAE,cA0BpB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GHA060: Over-Scoped Generated Token
|
|
3
|
+
*
|
|
4
|
+
* Flags a GitHub App installation token minted with a `permission-<scope>:
|
|
5
|
+
* write`/`admin` input broader than what the job's consuming steps evidence.
|
|
6
|
+
* Targets the well-known GitHub App token actions (`actions/create-github-app-
|
|
7
|
+
* token`, `tibdex/github-app-token`, `getsentry/action-github-app-token`),
|
|
8
|
+
* which take `permission-<resource>: read|write|admin` inputs and hand back
|
|
9
|
+
* the minted token as a step output.
|
|
10
|
+
*
|
|
11
|
+
* Two ways a generated token is over-scoped:
|
|
12
|
+
* 1. Unused — the token's output (`steps.<id>.outputs.token`) is never
|
|
13
|
+
* referenced by any other step in the job, so every write/admin scope
|
|
14
|
+
* granted is pure waste.
|
|
15
|
+
* 2. No signal — the token IS consumed, but no other step in the job shows
|
|
16
|
+
* any evidence (a `gh`/`git` invocation, an API path, a keyword) of
|
|
17
|
+
* exercising a scope granted `write`/`admin`.
|
|
18
|
+
*
|
|
19
|
+
* "No signal" is a heuristic, not a proof — a step could exercise a scope
|
|
20
|
+
* through machinery this doesn't recognize (a custom script calling `octokit`
|
|
21
|
+
* directly, say). It reports `guidance`, not a `deterministic` fix, for
|
|
22
|
+
* exactly that reason: a human confirms before narrowing the grant.
|
|
23
|
+
*/
|
|
24
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
25
|
+
export interface OverScopedTokenFinding {
|
|
26
|
+
job: string;
|
|
27
|
+
stepId: string;
|
|
28
|
+
scopes: string[];
|
|
29
|
+
reason: "unused" | "no-signal";
|
|
30
|
+
}
|
|
31
|
+
/** Find every generated GitHub App token whose granted write/admin scopes exceed what the job's other steps evidence. */
|
|
32
|
+
export declare function findOverScopedTokens(yaml: string): OverScopedTokenFinding[];
|
|
33
|
+
export declare const gha060: PostSynthCheck;
|
|
34
|
+
//# sourceMappingURL=gha060.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gha060.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/gha060.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAyC9G,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAC;CAChC;AAED,yHAAyH;AACzH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,EAAE,CA2C3E;AAED,eAAO,MAAM,MAAM,EAAE,cA2BpB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GHA061: Action Reference Outside the Configured Usage Policy
|
|
3
|
+
*
|
|
4
|
+
* An opt-in allow/deny check over third-party `uses:` references, for
|
|
5
|
+
* environments that constrain which external components may run at all —
|
|
6
|
+
* distinct from GHA029/031/032, which judge a reference on its own pinning/
|
|
7
|
+
* naming/health, not against an organizational decision about who is trusted.
|
|
8
|
+
*
|
|
9
|
+
* Ships silent: `DEFAULT_ACTION_USAGE_POLICY` (../rules/data/action-usage-
|
|
10
|
+
* policy.ts) is empty, and {@link evaluateUsagePolicy} returns no findings
|
|
11
|
+
* for an empty policy — see that module's doc for why (`PostSynthContext`
|
|
12
|
+
* carries no per-check runtime config channel) and how a project actually
|
|
13
|
+
* opts in: author a `lint.policies` entry that calls `evaluateUsagePolicy`
|
|
14
|
+
* with its own policy, wrapped in a `PostSynthCheck`.
|
|
15
|
+
*/
|
|
16
|
+
import type { PostSynthCheck, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
17
|
+
import { type ActionUsagePolicy } from "../rules/data/action-usage-policy.js";
|
|
18
|
+
export type { ActionUsagePolicy } from "../rules/data/action-usage-policy.js";
|
|
19
|
+
/**
|
|
20
|
+
* Evaluate a workflow's `uses:` references against a usage policy. Pure: no
|
|
21
|
+
* fs, no network, no default policy baked in — an empty/unset policy (no
|
|
22
|
+
* `allow` and no `deny`) always yields no findings, which is what makes this
|
|
23
|
+
* genuinely opt-in rather than "opt-in by omission of one flag."
|
|
24
|
+
*/
|
|
25
|
+
export declare function evaluateUsagePolicy(yaml: string, policy: ActionUsagePolicy): PostSynthDiagnostic[];
|
|
26
|
+
export declare const gha061: PostSynthCheck;
|
|
27
|
+
//# sourceMappingURL=gha061.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gha061.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/gha061.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAoB,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE9G,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAExG,YAAY,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAa3E;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,mBAAmB,EAAE,CA+BlG;AAED,eAAO,MAAM,MAAM,EAAE,cAYpB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GHA062: Pinned Reference Matches a Known-Vulnerability Advisory
|
|
3
|
+
*
|
|
4
|
+
* Cross-references every pinned `uses:` (commit SHA or tag/branch) against a
|
|
5
|
+
* caller-supplied advisory feed and flags a match. Unlike GHA031/032's
|
|
6
|
+
* vendored, committed reference lists, a vulnerability feed is meant to be
|
|
7
|
+
* refreshed continuously — so this rule takes it as data, not code: the pure
|
|
8
|
+
* core never fetches (epic #350's design spine), and an absent/empty feed
|
|
9
|
+
* degrades to "no findings," never an error or a thrown exception. That is
|
|
10
|
+
* what "unreachable" means for a rule that makes no network call of its own:
|
|
11
|
+
* whatever couldn't reach the feed already failed upstream of this function,
|
|
12
|
+
* and this function's job is to not compound that with a crash.
|
|
13
|
+
*/
|
|
14
|
+
import type { PostSynthCheck, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
|
|
15
|
+
import { type AdvisoryFeed } from "../rules/data/advisory-feed.js";
|
|
16
|
+
export type { AdvisoryFeed, AdvisoryEntry } from "../rules/data/advisory-feed.js";
|
|
17
|
+
/**
|
|
18
|
+
* Check a workflow's pinned action references against an advisory feed. Pure
|
|
19
|
+
* and total: a missing/empty feed (`entries.length === 0`, including the
|
|
20
|
+
* `undefined` default) always yields `[]`, never a throw.
|
|
21
|
+
*/
|
|
22
|
+
export declare function checkAdvisories(yaml: string, feed?: AdvisoryFeed | undefined): PostSynthDiagnostic[];
|
|
23
|
+
export declare const gha062: PostSynthCheck;
|
|
24
|
+
//# sourceMappingURL=gha062.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gha062.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/gha062.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAoB,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE9G,OAAO,EAAyB,KAAK,YAAY,EAAsB,MAAM,6BAA6B,CAAC;AAE3G,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAS/E;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,YAAY,GAAG,SAAiC,GAAG,mBAAmB,EAAE,CAqB3H;AAED,eAAO,MAAM,MAAM,EAAE,cAYpB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GHA063: Dependency Setup Without Caching
|
|
3
|
+
*
|
|
4
|
+
* Flags a `actions/setup-{node,python,java,ruby,dotnet}` step that leaves its
|
|
5
|
+
* built-in `cache:` option unset, with no adjacent `actions/cache` step to
|
|
6
|
+
* cover the gap. Every run re-downloads the same dependencies from the
|
|
7
|
+
* registry from a cold cache — pure wasted time and bandwidth, not a
|
|
8
|
+
* correctness or security issue (efficiency, #444).
|
|
9
|
+
*/
|
|
10
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
11
|
+
export declare const gha063: PostSynthCheck;
|
|
12
|
+
//# sourceMappingURL=gha063.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gha063.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/gha063.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAc9G,eAAO,MAAM,MAAM,EAAE,cAmCpB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GHA064: Expensive Runner Without Justification
|
|
3
|
+
*
|
|
4
|
+
* Flags a job hardcoded onto a pricier macOS/Windows runner (billed at a
|
|
5
|
+
* multiple of Linux minutes) when none of its `run:` steps show any sign the
|
|
6
|
+
* job actually needs that OS. A matrix-driven `runs-on: ${{ matrix.os }}`
|
|
7
|
+
* (intentional cross-platform testing) is never flagged — only a literal,
|
|
8
|
+
* hardcoded label. Efficiency (#444), not a correctness/security issue.
|
|
9
|
+
*/
|
|
10
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
11
|
+
export declare const gha064: PostSynthCheck;
|
|
12
|
+
//# sourceMappingURL=gha064.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gha064.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/gha064.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAQ9G,eAAO,MAAM,MAAM,EAAE,cAoCpB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GHA065: Unbounded Matrix Fan-Out
|
|
3
|
+
*
|
|
4
|
+
* Flags a `strategy.matrix` that combines two or more dimensions into more
|
|
5
|
+
* jobs than a `max-parallel:` cap bounds. Two orthogonal axes each with a
|
|
6
|
+
* handful of values multiply, not add — `os` x `node` x `arch` can produce
|
|
7
|
+
* dozens of jobs from a config that reads like a short list. Unbounded, that
|
|
8
|
+
* is capacity spent on a combination nobody asked for, not a correctness or
|
|
9
|
+
* security issue (efficiency, #444).
|
|
10
|
+
*
|
|
11
|
+
* Parses the `matrix:` block by indentation, not the structural YAML parser
|
|
12
|
+
* — a flow list of bare words (`os: [ubuntu-latest, macos-latest]`, the
|
|
13
|
+
* overwhelmingly common hand-written form) is not one it round-trips, only
|
|
14
|
+
* a flow list of numbers. Mirrors GHA009's regex-based matrix handling for
|
|
15
|
+
* the same reason.
|
|
16
|
+
*/
|
|
17
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
18
|
+
export declare const gha065: PostSynthCheck;
|
|
19
|
+
//# sourceMappingURL=gha065.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gha065.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/gha065.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AA6E9G,eAAO,MAAM,MAAM,EAAE,cAkCpB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GHA066: Unbounded Artifact Retention
|
|
3
|
+
*
|
|
4
|
+
* Flags an `actions/upload-artifact` step with no `retention-days`, which
|
|
5
|
+
* falls back to the repository's default (up to 90 days). Build logs, test
|
|
6
|
+
* output, and intermediate artifacts rarely need to outlive the PR they came
|
|
7
|
+
* from; an unset retention silently accumulates storage. Efficiency (#444),
|
|
8
|
+
* not a correctness or security issue.
|
|
9
|
+
*/
|
|
10
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
11
|
+
export declare const gha066: PostSynthCheck;
|
|
12
|
+
//# sourceMappingURL=gha066.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gha066.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/gha066.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,MAAM,EAAE,cAiCpB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GHA067: Unconditional Heavy Step With No Path Filter
|
|
3
|
+
*
|
|
4
|
+
* Flags a `docker build`/`docker buildx build` step that has no `if:` guard,
|
|
5
|
+
* in a workflow that triggers on `push`/`pull_request` with no `paths:` or
|
|
6
|
+
* `paths-ignore:` filter. A docs-only or unrelated change still pays for a
|
|
7
|
+
* full image build because nothing scopes the trigger or guards the step.
|
|
8
|
+
* Efficiency (#444), not a correctness or security issue.
|
|
9
|
+
*/
|
|
10
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
11
|
+
export declare const gha067: PostSynthCheck;
|
|
12
|
+
//# sourceMappingURL=gha067.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gha067.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/gha067.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AA+B9G,eAAO,MAAM,MAAM,EAAE,cAkCpB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GHA068: Pull-Request Workflow Missing a Concurrency Group
|
|
3
|
+
*
|
|
4
|
+
* Flags a workflow triggered on `pull_request` with no top-level
|
|
5
|
+
* `concurrency:` block. Without one, a superseded push keeps its old run
|
|
6
|
+
* going instead of cancelling it, so every commit on a PR pays for the full
|
|
7
|
+
* pipeline instead of just the latest. Deploy workflows are left to GHA024,
|
|
8
|
+
* which already covers them (overlapping-deployment risk, not capacity).
|
|
9
|
+
* Efficiency (#444), not a correctness or security issue.
|
|
10
|
+
*/
|
|
11
|
+
import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
|
|
12
|
+
export declare const gha068: PostSynthCheck;
|
|
13
|
+
//# sourceMappingURL=gha068.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gha068.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/gha068.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAU9G,eAAO,MAAM,MAAM,EAAE,cA6BpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAyDvE,eAAO,MAAM,eAAe,EAAE,cAAc,EAwD3C,CAAC"}
|
|
@@ -64,6 +64,18 @@ export interface ImageRef {
|
|
|
64
64
|
/** Where the image was declared. */
|
|
65
65
|
source: "container" | "service" | "step";
|
|
66
66
|
}
|
|
67
|
+
/** Parse a workflow YAML into a structured document, tolerant of parse errors. */
|
|
68
|
+
export declare function parseDoc(yaml: string): Record<string, unknown> | undefined;
|
|
69
|
+
/** Every job in the workflow as `[name, rawJobObject]`, via the structural parser. */
|
|
70
|
+
export declare function jobEntries(yaml: string): Array<[string, Record<string, unknown>]>;
|
|
71
|
+
/**
|
|
72
|
+
* Every step object (raw, as parsed from YAML — `uses`, `with`, `id`, `run`,
|
|
73
|
+
* `env`, etc.) grouped by owning job. Unlike {@link extractJobs} (which only
|
|
74
|
+
* lifts `uses`/`run`/`name`), this hands back each step's full object so a
|
|
75
|
+
* check can read arbitrary keys (`with:` inputs, `id:`) without growing a new
|
|
76
|
+
* bespoke regex extractor per key. See GHA060.
|
|
77
|
+
*/
|
|
78
|
+
export declare function extractStepsByJob(yaml: string): Map<string, Array<Record<string, unknown>>>;
|
|
67
79
|
/**
|
|
68
80
|
* Extract every `uses:` reference from the workflow — both step-level actions
|
|
69
81
|
* and job-level reusable-workflow calls. Uses the structural YAML parser so
|
|
@@ -134,6 +146,14 @@ export declare function grantsWrite(perms: PermissionsValue): boolean;
|
|
|
134
146
|
* style) is safe to trim back to `<ref>`.
|
|
135
147
|
*/
|
|
136
148
|
export declare function stripUsesComment(uses: string): string;
|
|
149
|
+
/**
|
|
150
|
+
* Extract a `uses:` value's trailing inline comment, if any — the
|
|
151
|
+
* human-readable version label reviewers rely on when a ref is pinned to an
|
|
152
|
+
* opaque commit SHA (e.g. `actions/setup-node@1a2b…9a0b # v4.0.2` → `v4.0.2`).
|
|
153
|
+
* Returns undefined for no comment or an empty (`# ` with nothing after it)
|
|
154
|
+
* one, since both mean "no annotation" to a reviewer. See GHA059.
|
|
155
|
+
*/
|
|
156
|
+
export declare function extractUsesComment(rawUses: string): string | undefined;
|
|
137
157
|
export declare function parseActionUses(rawUses: string): {
|
|
138
158
|
owner: string;
|
|
139
159
|
repo: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-helpers.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/yaml-helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAGvF;AAED,iEAAiE;AACjE,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAS/F;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;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,CAQjF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAS7F;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAG5D;AAED;;;;GAIG;AACH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAItE;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAS1H"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default action-usage policy for GHA061 — opt-in, so it ships with an empty
|
|
3
|
+
* allow/deny list: with nothing configured, GHA061 reports nothing (#445
|
|
4
|
+
* acceptance criteria: "silent when unconfigured").
|
|
5
|
+
*
|
|
6
|
+
* `PostSynthContext` carries no per-check runtime config channel today (see
|
|
7
|
+
* `trusted-action-owners.ts`'s doc for the same constraint), so — like that
|
|
8
|
+
* file — this is a vendored, code-level default. A project that wants a real
|
|
9
|
+
* policy doesn't edit this file: it authors a `lint.policies` entry
|
|
10
|
+
* (`chant.config.ts`'s `lint.policies`, see `packages/core/src/lint/config.ts`)
|
|
11
|
+
* that imports `evaluateUsagePolicy` from `../../post-synth/gha061` and calls
|
|
12
|
+
* it with its own `ActionUsagePolicy`, wrapped in a `PostSynthCheck`. That is
|
|
13
|
+
* the supported opt-in path; this default only documents the "nothing
|
|
14
|
+
* configured" shape and is what the shipped GHA061 check itself passes.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* An opt-in allow/deny policy over third-party action references.
|
|
18
|
+
* Entries match an exact `owner/repo` slug, a bare `owner` (every repo under
|
|
19
|
+
* that owner), or an `owner/*` wildcard (equivalent to a bare owner, offered
|
|
20
|
+
* for readability). `deny` always wins over `allow` for an entry that somehow
|
|
21
|
+
* appears in both.
|
|
22
|
+
*/
|
|
23
|
+
export interface ActionUsagePolicy {
|
|
24
|
+
/** If set, any reference whose owner/slug isn't matched here is flagged. Unset = no allowlist restriction. */
|
|
25
|
+
allow?: string[];
|
|
26
|
+
/** Always flagged, regardless of `allow`. */
|
|
27
|
+
deny?: string[];
|
|
28
|
+
}
|
|
29
|
+
export declare const DEFAULT_ACTION_USAGE_POLICY: ActionUsagePolicy;
|
|
30
|
+
//# sourceMappingURL=action-usage-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-usage-policy.d.ts","sourceRoot":"","sources":["../../../../src/lint/rules/data/action-usage-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,8GAA8G;IAC9G,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,eAAO,MAAM,2BAA2B,EAAE,iBAAsB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default advisory feed for GHA062 — ships empty, so the check degrades to
|
|
3
|
+
* "no findings" rather than erroring when nothing is supplied (#445
|
|
4
|
+
* acceptance criteria: "degrades gracefully when the feed is unreachable").
|
|
5
|
+
*
|
|
6
|
+
* Per epic #350's design spine, the pure core never fetches: a live feed is
|
|
7
|
+
* the CALLER's concern (a `chant audit` CLI flag reading a local JSON file,
|
|
8
|
+
* a pre-fetched structure a hosted service passes in) — never a `fetch()`
|
|
9
|
+
* inside a rule. This module documents the "nothing supplied" shape and is
|
|
10
|
+
* what the shipped GHA062 check itself passes; a caller with a real feed
|
|
11
|
+
* calls `checkAdvisories` (`../../post-synth/gha062`) directly with its own
|
|
12
|
+
* `AdvisoryFeed`, the same way a `lint.policies` entry supplies GHA061 its
|
|
13
|
+
* own `ActionUsagePolicy` (see `action-usage-policy.ts`).
|
|
14
|
+
*/
|
|
15
|
+
/** One disclosed advisory affecting a pinned action reference. */
|
|
16
|
+
export interface AdvisoryEntry {
|
|
17
|
+
/** `owner/repo` slug the advisory applies to. */
|
|
18
|
+
slug: string;
|
|
19
|
+
/** Affected commit SHA(s) — for SHA-pinned refs. */
|
|
20
|
+
shas?: string[];
|
|
21
|
+
/** Affected tag/branch ref(s) — for refs still pinned to a mutable tag. */
|
|
22
|
+
refs?: string[];
|
|
23
|
+
/** Advisory identifier (e.g. a GHSA id). */
|
|
24
|
+
id: string;
|
|
25
|
+
/** Human-readable summary of the issue. */
|
|
26
|
+
summary: string;
|
|
27
|
+
/** A ref/SHA known to be patched, if the feed carries one. */
|
|
28
|
+
patchedRef?: string;
|
|
29
|
+
/** Link to the advisory. */
|
|
30
|
+
url?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface AdvisoryFeed {
|
|
33
|
+
entries: AdvisoryEntry[];
|
|
34
|
+
}
|
|
35
|
+
export declare const DEFAULT_ADVISORY_FEED: AdvisoryFeed;
|
|
36
|
+
//# sourceMappingURL=advisory-feed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"advisory-feed.d.ts","sourceRoot":"","sources":["../../../../src/lint/rules/data/advisory-feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,kEAAkE;AAClE,MAAM,WAAW,aAAa;IAC5B,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED,eAAO,MAAM,qBAAqB,EAAE,YAA8B,CAAC"}
|