What changed, and why it matters
This commit fixes bugs in an internal release-checking shell script used in continuous integration (CI). It tightens a grep pattern, prevents the script from crashing when the grep finds nothing, and updates the list of crates the script checks. There is no change to the Rust code that handles Bitcoin data, cryptography, or network messages, and no security-relevant behavior is introduced or fixed.
No security action needed; treat as a normal CI/maintenance fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies contrib/release.sh only. It sources contrib/test_vars.sh to obtain an up-to-date CRATES list instead of hardcoding bitcoin/hashes/internals/units, tightens release_changes() to grep for ‘+version =’ rather than the broader ‘version’ (which also matched ‘rust-version’ and git context lines), and wraps the grep in ‘set +e’ / ‘set -e’ so an empty result no longer exits the script under ‘set -e’. These are CI/release-process robustness fixes with no effect on runtime code.
Changed components
contrib/release.shInspect captured patch +21 / −6
diff --git a/contrib/release.sh b/contrib/release.sh
index c0265794..73abdd01 100755
--- a/contrib/release.sh
+++ b/contrib/release.sh
@@ -2,33 +2,48 @@
#
# Check that we can publish crates in their current form if there are changes on top of the tip of
# master that imply that we are about to do a release.
+#
+# disable follow sourced files.
+# shellcheck disable=SC1091
set -euox pipefail
+REPO_DIR=$(git rev-parse --show-toplevel)
+
+# Sets CRATES to be a list of all crates in the repo.
+. "$REPO_DIR"/contrib/test_vars.sh
+
main () {
- for crate in "bitcoin" "hashes" "internals" "units"; do
- if release_changes $crate; then
+ for crate in $CRATES; do
+ if release_changes "$crate"; then
echo "$crate has changes implying this is a release PR, checking if we can publish ..."
# Check if there is any mention of TBD which means the
# next version number should be filled in.
- if grep -qr "since = \"TBD" ./$crate; then
+ if grep -qr "since = \"TBD" "./$crate"; then
echo Version number needs to be filled in following places:
- grep -r "since = \"TBD" ./$crate
+ grep -r "since = \"TBD" "./$crate"
exit 1
fi
# Then try to dry-run cargo publish
- publish_dry_run $crate
+ publish_dry_run "$crate"
fi
done
}
# Returns 0 if crate ($1) contains changes since tip of master that imply this patch set is done in
# preparation for releasing the crate.
+
release_changes() {
local crate=$1
- git log --patch --reverse master.. -- "$crate"/Cargo.toml | grep version
+ set +e
+
+ git log --patch --reverse master.. -- "$crate"/Cargo.toml | grep -E '\+version ='
+ local exit_code=$?
+
+ set -e
+ return $exit_code
}
# Do a dry run publish to crates.io using the correct package name for crate ($1).
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.