Skip to content

Commit 5c690e7

Browse files
committed
fix(ci): crates already published guard was not working
- add missing user agent when requesting crates.io api for the latest published version of a crate. Explaination: The retrieval of the remote version on crates.io api was failing. To request their api they ask for an user agent in order to have a contact point if needed, if missing the request is rejected.
1 parent 5c5e30d commit 5c690e7

File tree

1 file changed

+1
-1
lines changed
  • .github/workflows/actions/publish-crate-package

1 file changed

+1
-1
lines changed

.github/workflows/actions/publish-crate-package/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
shell: bash
2424
run: |
2525
echo "Check crate latest published version for '${{ inputs.package }}' package"
26-
LATEST_REMOTE_VERSION=$(curl -sL https://crates.io/api/v1/crates/${{ inputs.package }} | jq -r '.crate.newest_version')
26+
LATEST_REMOTE_VERSION=$(curl -sL https://crates.io/api/v1/crates/${{ inputs.package }} --user-agent "iog/mithril (https://github.com/input-output-hk/mithril)" | jq -r '.crate.newest_version')
2727
LOCAL_VERSION=$(cargo metadata --quiet --no-deps | jq -r '.packages[] | select(.name=="${{ inputs.package }}") | .version')
2828
echo "Latest crate.io version: $LATEST_REMOTE_VERSION"
2929
echo "Local version: $LOCAL_VERSION"

0 commit comments

Comments
 (0)