ci(release): enforce canonical image references

This commit is contained in:
Timo
2026-09-01 03:45:18 +02:00
parent bc5d1a0ea6
commit 742386064c
3 changed files with 40 additions and 3 deletions
+15 -1
View File
@@ -5,7 +5,8 @@ import {
parseGateArgs,
parseRemoteMain,
playwrightImageFromLock,
validateReleaseWorkflowContract
validateReleaseWorkflowContract,
validateWorkflowImageReferences
} from './release-local-gate.mjs';
describe('local release gate contract', () => {
@@ -60,6 +61,19 @@ describe('local release gate contract', () => {
.toThrow('case-preserving github.repository');
});
it('enforces the canonical lowercase image across every workflow', () => {
expect(validateWorkflowImageReferences({
'release.yml': 'IMAGE: ghcr.io/shik3i/koalasync',
'beta.yml': 'images: ghcr.io/shik3i/koalasync:beta'
})).toBe('ghcr.io/shik3i/koalasync');
expect(() => validateWorkflowImageReferences({
'beta.yml': 'images: ghcr.io/${{ github.repository }}'
})).toThrow('case-preserving github.repository');
expect(() => validateWorkflowImageReferences({
'beta.yml': 'images: ghcr.io/Shik3i/KoalaSync'
})).toThrow('lowercase canonical image');
});
it('enforces the automatic version commit, direct push, prepared source, and final publication contract', () => {
const workflow = fs.readFileSync('.github/workflows/release.yml', 'utf8');
expect(validateReleaseWorkflowContract(workflow)).toBe('ghcr.io/shik3i/koalasync');