mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-09-03 22:45:21 +00:00
ci(release): enforce canonical image references
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user