Skip to content

Commit 723c95d

Browse files
fix(ci): improve tag signature verification with better debugging
- Add explicit tag object type checking and debugging - Provide more detailed error information when verification fails - Add fallback verification methods for troubleshooting - Show available tag refs to help diagnose issues This addresses the 'cannot verify a non-tag object' error by adding comprehensive debugging and alternative verification paths.
1 parent 650b001 commit 723c95d

1 file changed

Lines changed: 27 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,38 @@ jobs:
5252
git fetch origin "refs/tags/$TAG:refs/tags/$TAG"
5353
fi
5454
55-
# Show tag information for debugging
56-
echo "📋 Tag information:"
57-
git show --no-patch --format=" Type: %s%n Author: %an <%ae>%n Date: %ai" "$TAG" || echo "Could not show tag info"
55+
# Verify tag object type and show debugging info
56+
echo "🔍 Debugging tag object..."
57+
echo " Tag type: $(git cat-file -t "$TAG" 2>/dev/null || echo 'unknown')"
58+
echo " Tag exists in local refs: $(git tag -l | grep "^$TAG$" || echo 'NOT FOUND')"
59+
60+
# Show tag information for debugging (tag object, not commit)
61+
echo "📋 Tag object information:"
62+
if git cat-file -t "$TAG" | grep -q "tag"; then
63+
git cat-file tag "$TAG" | head -10
64+
else
65+
echo "⚠️ Not a tag object, showing commit info:"
66+
git show --no-patch --format=" Commit: %H%n Author: %an <%ae>%n Date: %ai%n Subject: %s" "$TAG"
67+
fi
5868
5969
# Verify the tag signature (will fail if tag is unsigned or signature is bad)
60-
if git verify-tag "$TAG"; then
70+
echo "🔐 Attempting tag signature verification..."
71+
if git verify-tag "$TAG" 2>&1; then
6172
echo "✅ Tag signature verified successfully"
6273
else
6374
echo "❌ Tag signature verification failed"
75+
echo "🔍 Attempting alternative verification methods..."
76+
77+
# Try explicit tag object verification
78+
if git cat-file -t "$TAG" | grep -q "tag"; then
79+
echo " Tag object exists, trying direct verification..."
80+
git verify-tag "$TAG" --verbose 2>&1 || true
81+
fi
82+
83+
# Show what refs we have
84+
echo " Available tag refs:"
85+
git for-each-ref refs/tags/ --format="%(refname:short) -> %(objecttype)" | grep "$TAG" || echo " No matching tag refs found"
86+
6487
exit 1
6588
fi
6689

0 commit comments

Comments
 (0)