Skip to content

Commit 14c90fc

Browse files
cdeckerclaude
andcommitted
ci: Fix cargo info checks to use --registry crates-io
Without --registry, cargo info resolves local workspace crates instead of querying crates.io. Also simplified to check exit code instead of grepping output. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 83a2681 commit 14c90fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ jobs:
342342
343343
# Check if this crate has been published before
344344
# If not, we can't run semver checks (nothing to compare against)
345-
if ! cargo info "$CRATE" 2>/dev/null | grep -q "^$CRATE"; then
345+
if ! cargo info "$CRATE" --registry crates-io &>/dev/null; then
346346
echo "ℹ️ Crate not yet published to crates.io - skipping semver check"
347347
echo " (First release has nothing to compare against)"
348348
exit 0
@@ -452,7 +452,7 @@ jobs:
452452
echo "🚀 Publishing $CRATE v$VERSION to crates.io..."
453453
454454
# Check if this version is already published (idempotent retries)
455-
if cargo info "${CRATE}@${VERSION}" 2>/dev/null | grep -q "^${CRATE}"; then
455+
if cargo info "${CRATE}@${VERSION}" --registry crates-io &>/dev/null; then
456456
echo "✅ $CRATE v$VERSION is already published on crates.io — skipping"
457457
else
458458
cargo publish -p "$CRATE"

0 commit comments

Comments
 (0)