Skip to content

Commit 6eb4154

Browse files
markovejnovicclaude
andcommitted
ci(release): send User-Agent to crates.io's API
crates.io now returns 403 for API calls without a User-Agent, so the existing pre-publish "already on crates.io" guard broke: curl -sf exited non-zero on the 403, the if-then didn't fire, and cargo publish ran and failed with "crate hm-plugin-protocol@VERSION already exists" when re-tagging after a partial-success run. Add -A "harmont-release-ci (github-actions)" to all three guards so the API returns 200 (exists) or 404 (free) as intended. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0b00b09 commit 6eb4154

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
4242
- name: Publish hm-plugin-protocol
4343
run: |
44-
if curl -sf "https://crates.io/api/v1/crates/hm-plugin-protocol/$VERSION" > /dev/null 2>&1; then
44+
if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/hm-plugin-protocol/$VERSION" > /dev/null 2>&1; then
4545
echo "hm-plugin-protocol@$VERSION already published, skipping"
4646
else
4747
cargo publish -p hm-plugin-protocol --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty
@@ -52,7 +52,7 @@ jobs:
5252

5353
- name: Publish hm-plugin-sdk
5454
run: |
55-
if curl -sf "https://crates.io/api/v1/crates/hm-plugin-sdk/$VERSION" > /dev/null 2>&1; then
55+
if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/hm-plugin-sdk/$VERSION" > /dev/null 2>&1; then
5656
echo "hm-plugin-sdk@$VERSION already published, skipping"
5757
else
5858
cargo publish -p hm-plugin-sdk --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty
@@ -82,7 +82,7 @@ jobs:
8282
8383
- name: Publish harmont-cli
8484
run: |
85-
if curl -sf "https://crates.io/api/v1/crates/harmont-cli/$VERSION" > /dev/null 2>&1; then
85+
if curl -sf -A "harmont-release-ci (github-actions)" "https://crates.io/api/v1/crates/harmont-cli/$VERSION" > /dev/null 2>&1; then
8686
echo "harmont-cli@$VERSION already published, skipping"
8787
else
8888
cargo publish -p harmont-cli --token ${{ secrets.CRATES_IO_TOKEN }} --allow-dirty

0 commit comments

Comments
 (0)