@intentius/chant-lexicon-forgejo 0.124.70 → 0.124.71

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ci-jobs.d.ts","sourceRoot":"","sources":["../../src/components/ci-jobs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iEAAiE,CAAC;AAC3G,OAAO,EAA2B,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEjF,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAElH;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQ5F;AAED,0FAA0F;AAC1F,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,EAAE,CAQ1E;AAED,mHAAmH;AACnH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAOlF;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe;IAAK,iBAAiB;CAAqC,CAAC;AAExF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,mBAAmB,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAcnI"}
1
+ {"version":3,"file":"ci-jobs.d.ts","sourceRoot":"","sources":["../../src/components/ci-jobs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iEAAiE,CAAC;AAC3G,OAAO,EAA2B,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEjF,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAElH;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQ5F;AAED,0FAA0F;AAC1F,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,EAAE,CAQ1E;AAED,mHAAmH;AACnH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAOlF;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe;IAAK,iBAAiB;CAAqC,CAAC;AAExF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,mBAAmB,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAenI"}
@@ -69,5 +69,6 @@ export function forgejoWorkflowDoc(doc, dialect, header) {
69
69
  ...(doc.gatedNoticeDoc ? { gatedNoticeDoc: forgejoize(doc.gatedNoticeDoc, dialect) } : {}),
70
70
  ...(doc.reviewNoteDoc ? { reviewNoteDoc: forgejoize(doc.reviewNoteDoc, dialect) } : {}),
71
71
  ...(doc.agentDoc ? { agentDoc: forgejoize(doc.agentDoc, dialect) } : {}),
72
+ ...(doc.commitDoc ? { commitDoc: forgejoize(doc.commitDoc, dialect) } : {}),
72
73
  };
73
74
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "41aee4ba1fe4330d30fab53fc1d593863b4cf4f4c6f0ac9960f6b20de7f8ef82",
4
+ "manifest.json": "6a424cce881bff76f2679f43d60617e2936640c58dfc351aa39bebb5e3905ed0",
5
5
  "meta.json": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
6
6
  "types/index.d.ts": "66204549b2a864ab5489e3f02c1878e73ab4b3c9d938cfb480b66f71543a43de",
7
7
  "rules/delegate-to-github.ts": "1060cda40f4b73d6cca3ba3fa13b80b4886147d4034c88584c2d80c5510dbe5e",
@@ -9,5 +9,5 @@
9
9
  "rules/wfj011.ts": "fcb8bf6685d744af20ad804ce929488257995c74b9a3353b2eacae3768d1c83e",
10
10
  "skills/chant-forgejo.md": "f28d7fb69fb1cfd992496ef41fda0ea5ccd54a29b84ea1c501a44f6a3992c4d5"
11
11
  },
12
- "composite": "eba0a5d9ab481245353bcdff350575f6a19421e1c38c3c0b5bc72bc52424a3f6"
12
+ "composite": "ae0a7f6167e51bfeb200bda154f8c00f426f8ff149bce9cca6fd731166b56f03"
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forgejo",
3
- "version": "0.124.70",
3
+ "version": "0.124.71",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "Forgejo",
6
6
  "intrinsics": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-forgejo",
3
- "version": "0.124.70",
3
+ "version": "0.124.71",
4
4
  "description": "Forgejo / Codeberg / Gitea Actions lexicon for chant — a thin GitHub Actions dialect",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -54,8 +54,8 @@
54
54
  },
55
55
  "peerDependencies": {
56
56
  "zod": "^4.3.6",
57
- "@intentius/chant": "^0.124.70",
58
- "@intentius/chant-lexicon-github": "^0.124.70"
57
+ "@intentius/chant": "^0.124.71",
58
+ "@intentius/chant-lexicon-github": "^0.124.71"
59
59
  },
60
60
  "scripts": {
61
61
  "generate": "tsx src/codegen/generate-cli.ts",
@@ -78,5 +78,6 @@ export function forgejoWorkflowDoc(doc: GithubOpPipelineDoc, dialect: ForgejoDia
78
78
  ...(doc.gatedNoticeDoc ? { gatedNoticeDoc: forgejoize(doc.gatedNoticeDoc, dialect) } : {}),
79
79
  ...(doc.reviewNoteDoc ? { reviewNoteDoc: forgejoize(doc.reviewNoteDoc, dialect) } : {}),
80
80
  ...(doc.agentDoc ? { agentDoc: forgejoize(doc.agentDoc, dialect) } : {}),
81
+ ...(doc.commitDoc ? { commitDoc: forgejoize(doc.commitDoc, dialect) } : {}),
81
82
  };
82
83
  }
@@ -0,0 +1,22 @@
1
+ /** #4622: a scheduled Op's job keeps named artifacts after its run, with the upload action Forgejo runs. */
2
+ import { describe, expect, test } from "vitest";
3
+ import { parseYAML } from "@intentius/chant/yaml";
4
+ import { generateForgejoOpPipeline } from "./generate-op-pipeline";
5
+ import { ACTION_PINS } from "@intentius/chant/action-pins";
6
+ import type { ScheduledOpSpec } from "@intentius/chant/lexicon";
7
+
8
+ type Step = { if?: string; uses?: string; run?: string; with?: Record<string, unknown> };
9
+
10
+ describe("scheduled Op artifacts on Forgejo (#4622)", () => {
11
+ test("each artifact is an upload-artifact v3 step after the run, kept whatever the run ended with", () => {
12
+ const spec: ScheduledOpSpec = { name: "drift", schedule: "0 6 * * *", artifacts: [{ name: "drift-report", paths: ["reports/"], retentionDays: 7 }] };
13
+ const doc = parseYAML(generateForgejoOpPipeline([spec]).files[0]!.yaml) as { jobs: Record<string, { steps: Step[] }> };
14
+ const s = doc.jobs.drift!.steps;
15
+ const run = s.findIndex((x) => x.run?.includes("chant run drift"));
16
+ const up = s.findIndex((x) => x.uses?.startsWith("actions/upload-artifact@") || x.uses?.includes("/upload-artifact@"));
17
+ expect(up).toBeGreaterThan(run);
18
+ expect(s[up]!.uses).toContain(ACTION_PINS.uploadArtifact3.sha);
19
+ expect(s[up]!.if).toBe("always()");
20
+ expect(s[up]!.with).toEqual({ name: "drift-report", path: "reports/", "if-no-files-found": "ignore", "retention-days": 7 });
21
+ });
22
+ });
@@ -0,0 +1,28 @@
1
+ /** The commit jobs on Forgejo (#4722): GitHub's jobs under the Forgejo dialect. */
2
+ import { describe, expect, test } from "vitest";
3
+ import { parseYAML } from "@intentius/chant/yaml";
4
+ import type { ScheduledOpSpec } from "@intentius/chant/lexicon";
5
+ import { generateForgejoOpPipeline } from "./generate-op-pipeline";
6
+
7
+ type Job = { if?: string; permissions?: unknown; steps: Array<{ env?: Record<string, string>; run?: string }> };
8
+
9
+ describe("commit jobs on Forgejo (#4722)", () => {
10
+ test("ask the forge who may write, drop permissions, and push with the token through the Forgejo client", () => {
11
+ const spec: ScheduledOpSpec = { name: "chant-fmt", commit: { on: "comment", comment: "/chant fmt", command: ["tofu", "fmt"], allowed: ["infra/"], tokenEnv: "CHANT_PUSH_TOKEN" } };
12
+ const doc = parseYAML(generateForgejoOpPipeline([spec]).files[0]!.yaml) as { jobs: Record<string, Job> };
13
+ const commit = doc.jobs["chant-fmt"]!;
14
+ expect(commit.if).toContain("github.event.is_pull");
15
+ expect(commit.if).not.toContain("author_association");
16
+ expect(commit.permissions).toBeUndefined();
17
+ const land = doc.jobs["chant-fmt-push"]!.steps.at(-1)!;
18
+ expect(land.env).toMatchObject({ CHANT_FORGEJO_TOKEN: "${{ secrets.CHANT_PUSH_TOKEN }}" });
19
+ expect(land.run).toContain("chant commit land --forge forgejo");
20
+ });
21
+
22
+ test("a check commit job follows the check", () => {
23
+ const spec: ScheduledOpSpec = { name: "fmt-check", trigger: { kind: "pull_request" }, commit: { on: "check", command: ["tofu", "fmt"], allowed: ["infra/"], tokenEnv: "CHANT_PUSH_TOKEN" } };
24
+ const doc = parseYAML(generateForgejoOpPipeline([spec]).files[0]!.yaml) as { jobs: Record<string, Job & { needs?: string }> };
25
+ expect(doc.jobs["fmt-check-commit"]!.needs).toBe("fmt-check");
26
+ expect(doc.jobs["fmt-check-commit-push"]).toBeDefined();
27
+ });
28
+ });