Skip to content

Commit affa56e

Browse files
committed
ci: require a new version when assets change
1 parent 0767dc4 commit affa56e

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ node scripts/sync-skills.mjs --check
2828

2929
## Versions
3030

31-
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.
31+
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.
3232

3333
## Not accepted
3434

‎scripts/test/validate.test.mjs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@ test('a changed skill with a new version passes', async () => {
190190
assert.deepEqual(await validate(root, { base: 'HEAD~1' }), [])
191191
})
192192

193+
test('a changed icon needs a new version', async () => {
194+
// Directories and agents keep the cached copy of a version, so a new logo
195+
// reaches users only with a new version.
196+
await write(root, 'assets/icon.png', 'new png')
197+
git(root, 'commit', '-q', '-am', 'new icon')
198+
await assertOneError('version', { base: 'HEAD~1' })
199+
})
200+
193201
test('a README change needs no new version', async () => {
194202
await write(root, 'README.md', `${README}\nMore.\n`)
195203
git(root, 'commit', '-q', '-am', 'docs')

‎scripts/validate.mjs‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
22
// Checks that this repository is a valid, publishable plugin. Run as
33
// `node scripts/validate.mjs [--base <git ref>]`; exits 1 and lists what is
4-
// wrong. With --base it also requires a new version whenever the skills or a
5-
// manifest changed since that ref.
4+
// wrong. With --base it also requires a new version whenever the skills, the
5+
// assets or a manifest changed since that ref.
66
import { execFileSync } from 'node:child_process'
77
import { lstat, readFile } from 'node:fs/promises'
88
import path from 'node:path'
@@ -299,7 +299,10 @@ const isHigher = (version, than) => {
299299
return false
300300
}
301301

302-
/** A change to the skills or a manifest since `base` needs a higher version. */
302+
/**
303+
* A change to the skills, the assets or a manifest since `base` needs a higher
304+
* version: directories and agents keep the copy of each version they have.
305+
*/
303306
const checkVersionBump = async (root, base, errors) => {
304307
try {
305308
git(root, 'rev-parse', '--verify', '--quiet', `${base}^{commit}`)
@@ -314,6 +317,7 @@ const checkVersionBump = async (root, base, errors) => {
314317
base,
315318
'--',
316319
'skills',
320+
'assets',
317321
...VERSIONED_MANIFESTS,
318322
...MARKETPLACES,
319323
)

0 commit comments

Comments
 (0)