Skip to content

Commit e6b0e34

Browse files
authored
fix: RELEASED_VERSION in bash script
This PR fixes the logic of retrieving `RELEASED_VERSION` in `ensure-version-bump-and-changelog.sh`. The current logic breaks when a crate version is not tagged in the repo. e.g. in https://github.com/libp2p/rust-libp2p/actions/runs/16322151084/job/46102571787?pr=6102#step:13:35 Pull-Request: #6103.
1 parent 2435b60 commit e6b0e34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/ensure-version-bump-and-changelog.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ MERGE_BASE=$(git merge-base "$HEAD_SHA" "$PR_BASE") # Find the merge base. This
1010
SRC_DIFF_TO_BASE=$(git diff "$HEAD_SHA".."$MERGE_BASE" --name-status -- "$DIR_TO_CRATE/src" "$DIR_TO_CRATE/Cargo.toml")
1111
CHANGELOG_DIFF=$(git diff "$HEAD_SHA".."$MERGE_BASE" --name-only -- "$DIR_TO_CRATE/CHANGELOG.md")
1212

13-
RELEASED_VERSION=$(git tag --sort=version:refname | grep "^$CRATE-v" | tail -n1 | grep -Po "\d+\.\d+\.\d+(-.+)?")
13+
RELEASED_VERSION=$(curl -s -A "Github Action" https://crates.io/api/v1/crates/$CRATE | jq -r .crate.newest_version)
1414

1515

1616
# If the source files of this crate weren't touched in this PR, exit early.

0 commit comments

Comments
 (0)