Skip to content

Commit 761ea57

Browse files
Skip npm publish for existing MCP versions
1 parent ee16fa5 commit 761ea57

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/npm-publish.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,19 @@ jobs:
5353
if: github.event_name == 'workflow_dispatch' && inputs.dry_run
5454
run: npm pack --workspace packages/agentbodega-mcp --dry-run
5555

56-
- name: Publish
56+
- name: Check npm version
57+
id: npm-version
5758
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.dry_run)
59+
run: |
60+
version="$(node -p "require('./packages/agentbodega-mcp/package.json').version")"
61+
if npm view "@agentbodega/mcp@${version}" version >/dev/null 2>&1; then
62+
echo "published=true" >> "$GITHUB_OUTPUT"
63+
else
64+
echo "published=false" >> "$GITHUB_OUTPUT"
65+
fi
66+
67+
- name: Publish
68+
if: (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.dry_run)) && steps.npm-version.outputs.published != 'true'
5869
run: npm publish --workspace packages/agentbodega-mcp --access public --provenance
5970

6071
- name: Authenticate to MCP Registry

0 commit comments

Comments
 (0)