test: require exact ceremony workflow pins
All checks were successful
labels / labels (pull_request) Successful in 11s
ci / test (pull_request) Successful in 18s

This commit is contained in:
codex-bot-andresmgsl 2026-08-31 18:38:54 +00:00
parent 52e8d45b78
commit 3fac8096f7

View file

@ -13,10 +13,7 @@ const REPOSITORY_MIRROR = path.join(__dirname, '..', '.ceremony');
const ROOT_AGENTS = path.join(__dirname, '..', 'AGENTS.md'); const ROOT_AGENTS = path.join(__dirname, '..', 'AGENTS.md');
const CEREMONY_REPOSITORY = 'https://forgejo.heavyduty.builders/heavy-duty/ceremony'; const CEREMONY_REPOSITORY = 'https://forgejo.heavyduty.builders/heavy-duty/ceremony';
const CEREMONY_VERSION = '0.6.3'; const CEREMONY_VERSION = '0.6.3';
const CEREMONY_WORKFLOWS = [ const CEREMONY_WORKFLOWS = ['labels.yml', 'labels-sweep.yml'];
path.join(__dirname, '..', '.forgejo', 'workflows', 'labels.yml'),
path.join(__dirname, '..', '.forgejo', 'workflows', 'labels-sweep.yml'),
];
const cleanups = []; const cleanups = [];
process.on('exit', () => { process.on('exit', () => {
for (const dir of cleanups) fs.rmSync(dir, { recursive: true, force: true }); for (const dir of cleanups) fs.rmSync(dir, { recursive: true, force: true });
@ -148,8 +145,11 @@ test('repository carries the complete Forgejo 0.6.3 doctrine mirror and root rou
'mirror README does not identify the exact Forgejo ceremony source and version', 'mirror README does not identify the exact Forgejo ceremony source and version',
); );
for (const workflow of CEREMONY_WORKFLOWS) { for (const workflow of CEREMONY_WORKFLOWS) {
const contents = fs.readFileSync(workflow, 'utf8'); const contents = fs.readFileSync(path.join(__dirname, '..', '.forgejo', 'workflows', workflow), 'utf8');
assert.match(contents, new RegExp(`uses: heavy-duty/ceremony/.github/workflows/[^@]+@${CEREMONY_VERSION}`)); assert.ok(
contents.includes(`uses: heavy-duty/ceremony/.github/workflows/${workflow}@${CEREMONY_VERSION}`),
`${workflow} does not pin ceremony ${CEREMONY_VERSION}`,
);
} }
assert.match(mirrorReadme, /labels doctrine is vendored manually/); assert.match(mirrorReadme, /labels doctrine is vendored manually/);
assert.doesNotMatch(mirrorReadme, /The pin lives in `.github\/workflows\/release\.yml`/); assert.doesNotMatch(mirrorReadme, /The pin lives in `.github\/workflows\/release\.yml`/);