@intentius/chant-lexicon-github 0.0.18
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/integrity.json +31 -0
- package/dist/manifest.json +15 -0
- package/dist/meta.json +135 -0
- package/dist/rules/deprecated-action-version.ts +49 -0
- package/dist/rules/detect-secrets.ts +53 -0
- package/dist/rules/extract-inline-structs.ts +62 -0
- package/dist/rules/file-job-limit.ts +49 -0
- package/dist/rules/gha006.ts +58 -0
- package/dist/rules/gha009.ts +42 -0
- package/dist/rules/gha011.ts +40 -0
- package/dist/rules/gha017.ts +32 -0
- package/dist/rules/gha018.ts +40 -0
- package/dist/rules/gha019.ts +72 -0
- package/dist/rules/job-timeout.ts +59 -0
- package/dist/rules/missing-recommended-inputs.ts +61 -0
- package/dist/rules/no-hardcoded-secrets.ts +46 -0
- package/dist/rules/no-raw-expressions.ts +51 -0
- package/dist/rules/suggest-cache.ts +71 -0
- package/dist/rules/use-condition-builders.ts +45 -0
- package/dist/rules/use-matrix-builder.ts +44 -0
- package/dist/rules/use-typed-actions.ts +47 -0
- package/dist/rules/validate-concurrency.ts +66 -0
- package/dist/rules/yaml-helpers.ts +129 -0
- package/dist/skills/chant-github.md +29 -0
- package/dist/skills/github-actions-patterns.md +93 -0
- package/dist/types/index.d.ts +358 -0
- package/package.json +33 -0
- package/src/codegen/docs-cli.ts +3 -0
- package/src/codegen/docs.ts +1138 -0
- package/src/codegen/generate-cli.ts +36 -0
- package/src/codegen/generate-lexicon.ts +58 -0
- package/src/codegen/generate-typescript.ts +149 -0
- package/src/codegen/generate.ts +141 -0
- package/src/codegen/naming.ts +57 -0
- package/src/codegen/package.ts +65 -0
- package/src/codegen/parse.ts +700 -0
- package/src/codegen/patches.ts +46 -0
- package/src/composites/cache.ts +25 -0
- package/src/composites/checkout.ts +31 -0
- package/src/composites/composites.test.ts +675 -0
- package/src/composites/deploy-environment.ts +77 -0
- package/src/composites/docker-build.ts +120 -0
- package/src/composites/download-artifact.ts +24 -0
- package/src/composites/go-ci.ts +91 -0
- package/src/composites/index.ts +26 -0
- package/src/composites/node-ci.ts +71 -0
- package/src/composites/node-pipeline.ts +151 -0
- package/src/composites/python-ci.ts +92 -0
- package/src/composites/setup-go.ts +24 -0
- package/src/composites/setup-node.ts +26 -0
- package/src/composites/setup-python.ts +24 -0
- package/src/composites/upload-artifact.ts +27 -0
- package/src/coverage.ts +49 -0
- package/src/expression.test.ts +147 -0
- package/src/expression.ts +214 -0
- package/src/generated/index.d.ts +358 -0
- package/src/generated/index.ts +29 -0
- package/src/generated/lexicon-github.json +135 -0
- package/src/generated/runtime.ts +4 -0
- package/src/import/generator.test.ts +110 -0
- package/src/import/generator.ts +119 -0
- package/src/import/parser.test.ts +98 -0
- package/src/import/parser.ts +73 -0
- package/src/index.ts +53 -0
- package/src/lint/post-synth/gha006.ts +58 -0
- package/src/lint/post-synth/gha009.ts +42 -0
- package/src/lint/post-synth/gha011.ts +40 -0
- package/src/lint/post-synth/gha017.ts +32 -0
- package/src/lint/post-synth/gha018.ts +40 -0
- package/src/lint/post-synth/gha019.ts +72 -0
- package/src/lint/post-synth/post-synth.test.ts +318 -0
- package/src/lint/post-synth/yaml-helpers.ts +129 -0
- package/src/lint/rules/data/deprecated-versions.ts +13 -0
- package/src/lint/rules/data/known-actions.ts +13 -0
- package/src/lint/rules/data/recommended-inputs.ts +10 -0
- package/src/lint/rules/data/secret-patterns.ts +31 -0
- package/src/lint/rules/deprecated-action-version.ts +49 -0
- package/src/lint/rules/detect-secrets.ts +53 -0
- package/src/lint/rules/extract-inline-structs.ts +62 -0
- package/src/lint/rules/file-job-limit.ts +49 -0
- package/src/lint/rules/index.ts +17 -0
- package/src/lint/rules/job-timeout.ts +59 -0
- package/src/lint/rules/missing-recommended-inputs.ts +61 -0
- package/src/lint/rules/no-hardcoded-secrets.ts +46 -0
- package/src/lint/rules/no-raw-expressions.ts +51 -0
- package/src/lint/rules/rules.test.ts +365 -0
- package/src/lint/rules/suggest-cache.ts +71 -0
- package/src/lint/rules/use-condition-builders.ts +45 -0
- package/src/lint/rules/use-matrix-builder.ts +44 -0
- package/src/lint/rules/use-typed-actions.ts +47 -0
- package/src/lint/rules/validate-concurrency.ts +66 -0
- package/src/lsp/completions.test.ts +9 -0
- package/src/lsp/completions.ts +20 -0
- package/src/lsp/hover.test.ts +9 -0
- package/src/lsp/hover.ts +38 -0
- package/src/package-cli.ts +42 -0
- package/src/plugin.test.ts +128 -0
- package/src/plugin.ts +408 -0
- package/src/serializer.test.ts +270 -0
- package/src/serializer.ts +383 -0
- package/src/skills/github-actions-patterns.md +93 -0
- package/src/spec/fetch.ts +55 -0
- package/src/validate-cli.ts +19 -0
- package/src/validate.test.ts +12 -0
- package/src/validate.ts +32 -0
- package/src/variables.ts +44 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema augmentation patches for GitHub Actions Workflow JSON Schema.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface SchemaPatch {
|
|
6
|
+
description: string;
|
|
7
|
+
path: string;
|
|
8
|
+
apply(def: Record<string, unknown>): void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Registry of known schema patches.
|
|
13
|
+
* Currently empty — the SchemaStore workflow schema is well-maintained.
|
|
14
|
+
*/
|
|
15
|
+
export const schemaPatches: SchemaPatch[] = [];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Apply all registered patches to a parsed schema.
|
|
19
|
+
*/
|
|
20
|
+
export function applyPatches(schema: Record<string, unknown>): { applied: string[]; skipped: string[] } {
|
|
21
|
+
const applied: string[] = [];
|
|
22
|
+
const skipped: string[] = [];
|
|
23
|
+
|
|
24
|
+
for (const patch of schemaPatches) {
|
|
25
|
+
const segments = patch.path.split(".");
|
|
26
|
+
let target: Record<string, unknown> | undefined = schema;
|
|
27
|
+
|
|
28
|
+
for (const segment of segments) {
|
|
29
|
+
if (target && typeof target === "object" && segment in target) {
|
|
30
|
+
target = target[segment] as Record<string, unknown>;
|
|
31
|
+
} else {
|
|
32
|
+
target = undefined;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (target) {
|
|
38
|
+
patch.apply(target);
|
|
39
|
+
applied.push(patch.description);
|
|
40
|
+
} else {
|
|
41
|
+
skipped.push(`${patch.description} (path "${patch.path}" not found)`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return { applied, skipped };
|
|
46
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Composite } from "@intentius/chant";
|
|
2
|
+
|
|
3
|
+
export interface CacheActionProps {
|
|
4
|
+
path: string;
|
|
5
|
+
key: string;
|
|
6
|
+
restoreKeys?: string[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const CacheAction = Composite<CacheActionProps>((props) => {
|
|
10
|
+
const withObj: Record<string, string> = {
|
|
11
|
+
path: props.path,
|
|
12
|
+
key: props.key,
|
|
13
|
+
};
|
|
14
|
+
if (props.restoreKeys !== undefined) withObj["restore-keys"] = props.restoreKeys.join("\n");
|
|
15
|
+
|
|
16
|
+
const { createProperty } = require("@intentius/chant/runtime");
|
|
17
|
+
const StepClass = createProperty("GitHub::Actions::Step", "github");
|
|
18
|
+
const step = new StepClass({
|
|
19
|
+
name: "Cache",
|
|
20
|
+
uses: "actions/cache@v4",
|
|
21
|
+
with: withObj,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return { step };
|
|
25
|
+
}, "Cache");
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Composite } from "@intentius/chant";
|
|
2
|
+
|
|
3
|
+
export interface CheckoutProps {
|
|
4
|
+
ref?: string;
|
|
5
|
+
repository?: string;
|
|
6
|
+
fetchDepth?: number;
|
|
7
|
+
token?: string;
|
|
8
|
+
submodules?: boolean | string;
|
|
9
|
+
sshKey?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Checkout = Composite<CheckoutProps>((props) => {
|
|
13
|
+
const withObj: Record<string, string> = {};
|
|
14
|
+
if (props.ref !== undefined) withObj.ref = props.ref;
|
|
15
|
+
if (props.repository !== undefined) withObj.repository = props.repository;
|
|
16
|
+
if (props.fetchDepth !== undefined) withObj["fetch-depth"] = String(props.fetchDepth);
|
|
17
|
+
if (props.token !== undefined) withObj.token = props.token;
|
|
18
|
+
if (props.submodules !== undefined) withObj.submodules = String(props.submodules);
|
|
19
|
+
if (props.sshKey !== undefined) withObj["ssh-key"] = props.sshKey;
|
|
20
|
+
|
|
21
|
+
// Import Step lazily to avoid circular dependency at module load time
|
|
22
|
+
const { createProperty } = require("@intentius/chant/runtime");
|
|
23
|
+
const StepClass = createProperty("GitHub::Actions::Step", "github");
|
|
24
|
+
const step = new StepClass({
|
|
25
|
+
name: "Checkout",
|
|
26
|
+
uses: "actions/checkout@v4",
|
|
27
|
+
...(Object.keys(withObj).length > 0 ? { with: withObj } : {}),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return { step };
|
|
31
|
+
}, "Checkout");
|