Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,49 @@ jobs:
- run: git config user.name "github-actions[bot]"
- run: git config user.email "github-actions[bot]@users.noreply.github.com"
- run: npm ci
- name: Validate package metadata for trusted publishing
run: |
node - <<'NODE'
const { readFileSync } = require("node:fs");

const pkg = JSON.parse(readFileSync("package.json", "utf8"));
const expectedAuthor = "OpenClaw Team <dev@openclaw.ai>";
const expectedRepoUrl = "https://github.com/openclaw/acpx";

const normalizeRepoUrl = (value) =>
String(value ?? "")
.trim()
.replace(/^git\+/, "")
.replace(/\.git$/i, "")
.replace(/\/+$/, "");

const actualRepoUrl = normalizeRepoUrl(pkg?.repository?.url);
const expectedRepoUrlNormalized = normalizeRepoUrl(expectedRepoUrl);

const errors = [];
if (actualRepoUrl !== expectedRepoUrlNormalized) {
errors.push(
`package.json repository.url must resolve to ${expectedRepoUrlNormalized}; found ${actualRepoUrl || "<missing>"}`
);
}
if ((pkg?.author ?? "") !== expectedAuthor) {
errors.push(
`package.json author must be exactly "${expectedAuthor}"; found "${pkg?.author ?? ""}"`
);
}

if (errors.length > 0) {
for (const err of errors) {
console.error(err);
}
process.exit(1);
}

console.log("Package metadata validated.");
NODE
- run: npm run lint
- run: npm run typecheck
- run: npm run build
# Fetch latest version from npm, bump it, write to package.json.
# Nothing is committed — the bumped version lives only in the CI
# runner's working directory. release-it tags + publishes from it.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
"coding-agent",
"ai"
],
"author": "Janitr AI",
"author": "OpenClaw Team <dev@openclaw.ai>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/janitrai/acpx.git"
"url": "https://github.com/openclaw/acpx"
},
"engines": {
"node": ">=18"
Expand Down