@intentius/chant-lexicon-forgejo 0.116.0 → 0.117.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-waves-pipeline.d.ts +5 -0
- package/dist/components/generate-op-waves-pipeline.d.ts.map +1 -1
- package/dist/integrity.json +2 -2
- package/dist/manifest.json +1 -1
- package/package.json +3 -3
- package/src/components/generate-op-waves-pipeline.test.ts +10 -0
- package/src/components/generate-op-waves-pipeline.ts +24 -2
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
* none), and each wave's `environment:` dropped with a header line saying so,
|
|
7
7
|
* since Forgejo Actions has no environments. The wave's chant gate is what
|
|
8
8
|
* holds it there.
|
|
9
|
+
*
|
|
10
|
+
* With `resume` on the spec (#3683), `<name>-resume.yml` runs `chant run
|
|
11
|
+
* resume --op <name>` on that schedule. Forgejo has no API to re-run a run,
|
|
12
|
+
* so it dispatches the waves workflow again on its branch, with the
|
|
13
|
+
* `CHANT_FORGE_TOKEN` secret (a token with the `write:repository` scope).
|
|
9
14
|
*/
|
|
10
15
|
import type { OpWavesSpec } from "@intentius/chant/op/op-waves";
|
|
11
16
|
import type { OpWavesPipelineOptions, OpWavesPipelineResult } from "@intentius/chant/lexicon";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-op-waves-pipeline.d.ts","sourceRoot":"","sources":["../../src/components/generate-op-waves-pipeline.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"generate-op-waves-pipeline.d.ts","sourceRoot":"","sources":["../../src/components/generate-op-waves-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAA2B,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAMjF,6EAA6E;AAC7E,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,sBAAsB,EAC/B,cAAc,GAAE,qBAA0B,GACzC,qBAAqB,CA6CvB"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "bd0b5cbea165a77cb8a066acbf0d382f8dd45d8d767a4d88ae874e60bac02d0d",
|
|
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": "
|
|
12
|
+
"composite": "73b7f0b11a0b2392b370713f429927c565a53e71742ae5a10f2d3be661e9fc4c"
|
|
13
13
|
}
|
package/dist/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-forgejo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.117.0",
|
|
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.
|
|
58
|
-
"@intentius/chant-lexicon-github": "^0.
|
|
57
|
+
"@intentius/chant": "^0.117.0",
|
|
58
|
+
"@intentius/chant-lexicon-github": "^0.117.0"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"generate": "tsx src/codegen/generate-cli.ts",
|
|
@@ -30,4 +30,14 @@ describe("generateForgejoOpWavesPipeline", () => {
|
|
|
30
30
|
expect(yaml).toContain("run: chant run wave --spec waves.json --wave 3\n");
|
|
31
31
|
expect(yaml).toContain("fetch-depth: 0");
|
|
32
32
|
});
|
|
33
|
+
|
|
34
|
+
test("resume renders a scheduled workflow that dispatches with the CHANT_FORGE_TOKEN secret (#3683)", () => {
|
|
35
|
+
const { files } = generateForgejoOpWavesPipeline({ ...spec, resume: { schedule: "*/10 * * * *" } }, { specFile: "waves.json" });
|
|
36
|
+
expect(files.map((f) => f.name)).toEqual(["migrations.yml", "migrations-resume.yml"]);
|
|
37
|
+
const yaml = files[1]!.yaml;
|
|
38
|
+
expect(yaml).toContain("run: chant run resume --op migrations");
|
|
39
|
+
expect(yaml).toContain("CHANT_FORGE_TOKEN: '${{ secrets.CHANT_FORGE_TOKEN }}'");
|
|
40
|
+
expect(yaml).not.toContain("github.token");
|
|
41
|
+
expect(yaml).not.toMatch(/^permissions:/m);
|
|
42
|
+
});
|
|
33
43
|
});
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
* none), and each wave's `environment:` dropped with a header line saying so,
|
|
7
7
|
* since Forgejo Actions has no environments. The wave's chant gate is what
|
|
8
8
|
* holds it there.
|
|
9
|
+
*
|
|
10
|
+
* With `resume` on the spec (#3683), `<name>-resume.yml` runs `chant run
|
|
11
|
+
* resume --op <name>` on that schedule. Forgejo has no API to re-run a run,
|
|
12
|
+
* so it dispatches the waves workflow again on its branch, with the
|
|
13
|
+
* `CHANT_FORGE_TOKEN` secret (a token with the `write:repository` scope).
|
|
9
14
|
*/
|
|
10
15
|
|
|
11
16
|
import { buildGithubOpWavesDoc } from "@intentius/chant-lexicon-github/components/generate-op-waves-pipeline";
|
|
@@ -24,7 +29,7 @@ export function generateForgejoOpWavesPipeline(
|
|
|
24
29
|
options: OpWavesPipelineOptions,
|
|
25
30
|
dialectOptions: ForgejoDialectOptions = {},
|
|
26
31
|
): OpWavesPipelineResult {
|
|
27
|
-
const { doc, jobs } = buildGithubOpWavesDoc(spec, options);
|
|
32
|
+
const { doc, jobs, resumeDoc } = buildGithubOpWavesDoc(spec, options);
|
|
28
33
|
const jobsDoc = Object.fromEntries(
|
|
29
34
|
Object.entries(doc.jobsDoc).map(([name, job]) => {
|
|
30
35
|
const { environment: _dropped, ...rest } = job as Record<string, unknown>;
|
|
@@ -50,5 +55,22 @@ export function generateForgejoOpWavesPipeline(
|
|
|
50
55
|
permissions: {},
|
|
51
56
|
jobsDoc: forgejoize(jobsDoc, dialectOptions),
|
|
52
57
|
};
|
|
53
|
-
|
|
58
|
+
const files = [{ name: `${spec.name}.yml`, yaml: emitOpPipelineYAML(forgejoDoc) }];
|
|
59
|
+
if (resumeDoc) {
|
|
60
|
+
const resumeJobs = forgejoize(resumeDoc.jobsDoc, dialectOptions) as Record<string, { steps: Array<Record<string, unknown>> }>;
|
|
61
|
+
for (const job of Object.values(resumeJobs)) {
|
|
62
|
+
for (const step of job.steps) if (step.env) step.env = { CHANT_FORGE_TOKEN: "${{ secrets.CHANT_FORGE_TOKEN }}" };
|
|
63
|
+
}
|
|
64
|
+
files.push({
|
|
65
|
+
name: `${spec.name}-resume.yml`,
|
|
66
|
+
yaml: emitOpPipelineYAML({
|
|
67
|
+
name: resumeDoc.name!,
|
|
68
|
+
on: forgejoize(resumeDoc.on, dialectOptions),
|
|
69
|
+
concurrency: forgejoize(resumeDoc.concurrency, dialectOptions),
|
|
70
|
+
permissions: {},
|
|
71
|
+
jobsDoc: resumeJobs,
|
|
72
|
+
}),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return { files, jobs };
|
|
54
76
|
}
|