From affa56e843c7feb56ed66eabed4a75edcf7093e9 Mon Sep 17 00:00:00 2001 From: Tomasz Czubocha Date: Tue, 24 Nov 2026 19:15:44 +0000 Subject: [PATCH] ci: require a new version when assets change --- CONTRIBUTING.md | 2 +- scripts/test/validate.test.mjs | 8 ++++++++ scripts/validate.mjs | 10 +++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2e89524..3490931 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,7 +28,7 @@ node scripts/sync-skills.mjs --check ## Versions -Every manifest carries the same version. A change to a manifest or to a marketplace file needs a higher patch version in all of them, and an entry in `CHANGELOG.md`. A sync that changes a skill raises the minor version by itself. Once a version reaches `main`, the "Sync and release" workflow tags it and creates its GitHub Release. +Every manifest carries the same version. A change to a manifest, a marketplace file or `assets/` (such as the icon) needs a higher patch version in all of them, and an entry in `CHANGELOG.md`. A sync that changes a skill raises the minor version by itself. Once a version reaches `main`, the "Sync and release" workflow tags it and creates its GitHub Release. ## Not accepted diff --git a/scripts/test/validate.test.mjs b/scripts/test/validate.test.mjs index 3460273..ff78f57 100644 --- a/scripts/test/validate.test.mjs +++ b/scripts/test/validate.test.mjs @@ -190,6 +190,14 @@ test('a changed skill with a new version passes', async () => { assert.deepEqual(await validate(root, { base: 'HEAD~1' }), []) }) +test('a changed icon needs a new version', async () => { + // Directories and agents keep the cached copy of a version, so a new logo + // reaches users only with a new version. + await write(root, 'assets/icon.png', 'new png') + git(root, 'commit', '-q', '-am', 'new icon') + await assertOneError('version', { base: 'HEAD~1' }) +}) + test('a README change needs no new version', async () => { await write(root, 'README.md', `${README}\nMore.\n`) git(root, 'commit', '-q', '-am', 'docs') diff --git a/scripts/validate.mjs b/scripts/validate.mjs index 77d5fa3..4462bde 100644 --- a/scripts/validate.mjs +++ b/scripts/validate.mjs @@ -1,8 +1,8 @@ #!/usr/bin/env node // Checks that this repository is a valid, publishable plugin. Run as // `node scripts/validate.mjs [--base ]`; exits 1 and lists what is -// wrong. With --base it also requires a new version whenever the skills or a -// manifest changed since that ref. +// wrong. With --base it also requires a new version whenever the skills, the +// assets or a manifest changed since that ref. import { execFileSync } from 'node:child_process' import { lstat, readFile } from 'node:fs/promises' import path from 'node:path' @@ -299,7 +299,10 @@ const isHigher = (version, than) => { return false } -/** A change to the skills or a manifest since `base` needs a higher version. */ +/** + * A change to the skills, the assets or a manifest since `base` needs a higher + * version: directories and agents keep the copy of each version they have. + */ const checkVersionBump = async (root, base, errors) => { try { git(root, 'rev-parse', '--verify', '--quiet', `${base}^{commit}`) @@ -314,6 +317,7 @@ const checkVersionBump = async (root, base, errors) => { base, '--', 'skills', + 'assets', ...VERSIONED_MANIFESTS, ...MARKETPLACES, )