Skip to content

Commit de634be

Browse files
committed
fix: bake package ignore rules into skill publish release
Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
1 parent fd976aa commit de634be

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Immutability gives you:
1212

1313
A skill package is `SKILL.md` + `skill.json` (plus optional files). The action validates, quotes, publishes, waits for completion, and emits outputs.
1414

15-
By default, `skill-publish` excludes hidden files, env files, lockfiles, build output, local databases, and key/certificate material from package discovery before quote or publish.
15+
By default, `skill-publish` excludes hidden files and directories, env files, lockfiles, build output, local databases, and key/certificate material from package discovery before quote or publish.
1616

1717
[![npm](https://img.shields.io/npm/v/skill-publish?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/skill-publish)
1818
[![GitHub Marketplace](https://img.shields.io/badge/GitHub_Marketplace-skill--publish-2EA44F?style=for-the-badge&logo=github)](https://github.com/marketplace/actions/skill-publish)

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "skill-publish",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Publish trustless, immutable, on-chain skill releases via the HOL Registry Broker.",
55
"type": "module",
66
"homepage": "https://hol.org/registry/skills/publish",
@@ -59,6 +59,7 @@
5959
},
6060
"scripts": {
6161
"lint": "node --check entrypoint.mjs && node --check bin/cli.mjs && node --check bin/lib/broker-api.mjs && node --check bin/lib/create-command.mjs && node --check bin/lib/credential-store.mjs && node --check bin/lib/setup-command.mjs && node --check bin/lib/account-commands.mjs && node --check bin/lib/local-commands.mjs && node --check bin/lib/doctor-command.mjs && node --check bin/lib/start-command.mjs && node --check bin/lib/cli-help.mjs && node --check bin/lib/repo-commands.mjs && node --check bin/lib/package-files.mjs && node --check bin/lib/skill-package.mjs && node --check bin/lib/skill-presets.mjs && node --check bin/lib/distribution-kit.mjs && node --check bin/lib/distribution-commands.mjs && node --check bin/lib/codemeta.mjs && node --check bin/lib/indexnow.mjs && node --check bin/lib/apply-distribution-kit.mjs",
62+
"test:package-files": "node test/package-files.test.mjs",
6263
"smoke:help": "node bin/cli.mjs --help",
6364
"smoke:start": "node bin/cli.mjs start --non-interactive",
6465
"smoke:doctor": "node bin/cli.mjs doctor --json",

test/package-files.test.mjs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import assert from 'node:assert/strict';
2+
import { mkdtemp, mkdir, writeFile, rm } from 'node:fs/promises';
3+
import os from 'node:os';
4+
import path from 'node:path';
5+
6+
import { discoverSkillPackageFiles } from '../bin/lib/package-files.mjs';
7+
8+
const tempRoot = await mkdtemp(path.join(os.tmpdir(), 'skill-publish-test-'));
9+
10+
try {
11+
await writeFile(path.join(tempRoot, 'SKILL.md'), '# Test skill\n');
12+
await writeFile(path.join(tempRoot, 'skill.json'), '{"name":"test-skill","version":"1.0.0"}\n');
13+
await mkdir(path.join(tempRoot, '.github', 'workflows'), { recursive: true });
14+
await writeFile(path.join(tempRoot, '.github', 'workflows', 'publish.yml'), 'name: publish\n');
15+
await mkdir(path.join(tempRoot, '.hidden-cache'), { recursive: true });
16+
await writeFile(path.join(tempRoot, '.hidden-cache', 'artifact.txt'), 'secret-ish\n');
17+
await mkdir(path.join(tempRoot, 'docs'), { recursive: true });
18+
await writeFile(path.join(tempRoot, 'docs', 'guide.md'), 'Guide\n');
19+
await writeFile(path.join(tempRoot, '.env.local'), 'RB_API_KEY=should-not-ship\n');
20+
21+
const result = await discoverSkillPackageFiles(tempRoot);
22+
const included = result.includedFiles.map((file) => file.relativePath).sort();
23+
const excluded = result.excludedFiles.map((file) => `${file.relativePath}:${file.reason}`).sort();
24+
25+
assert.deepEqual(included, ['SKILL.md', 'docs/guide.md', 'skill.json']);
26+
assert.ok(excluded.includes('.github/:blocked-directory'));
27+
assert.ok(excluded.includes('.hidden-cache/:hidden-path'));
28+
assert.ok(excluded.includes('.env.local:hidden-path'));
29+
30+
process.stdout.write('package-files discovery test passed\n');
31+
} finally {
32+
await rm(tempRoot, { recursive: true, force: true });
33+
}

0 commit comments

Comments
 (0)