mirror of
https://github.com/xtr-dev/payload-mailing.git
synced 2025-12-10 08:13:23 +00:00
Add debug info and fallback for Claude CLI authentication issues
### 🐛 Bug Fixes - Added debugging information for Claude CLI installation and execution - Added fallback changelog generation from commit messages - Uses --dangerously-skip-permissions flag for CI environment ### 🔧 Improvements - Workflow now continues even if Claude CLI authentication fails - Provides detailed error information for debugging - Generates basic changelog from git commits as fallback - Maintains workflow execution without requiring Claude authentication ### 📚 Documentation - Added note in fallback changelog about authentication requirements - Clear messaging about fallback vs AI-generated changelogs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
30
.github/workflows/version-and-publish.yml
vendored
30
.github/workflows/version-and-publish.yml
vendored
@@ -120,6 +120,13 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "🤖 Generating changelog with Claude..."
|
echo "🤖 Generating changelog with Claude..."
|
||||||
|
|
||||||
|
# Debug Claude CLI installation
|
||||||
|
echo "🔍 Debugging Claude CLI..."
|
||||||
|
which claude || echo "Claude not in PATH"
|
||||||
|
claude --version || echo "Claude version check failed"
|
||||||
|
|
||||||
|
# Try Claude CLI first, fallback to manual changelog if it fails
|
||||||
PROMPT="Please analyze the following git commits and generate a concise changelog in this exact format:
|
PROMPT="Please analyze the following git commits and generate a concise changelog in this exact format:
|
||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
@@ -144,17 +151,32 @@ jobs:
|
|||||||
Git commits to analyze:
|
Git commits to analyze:
|
||||||
$COMMITS"
|
$COMMITS"
|
||||||
|
|
||||||
CHANGELOG=$(timeout 240s claude -p "$PROMPT")
|
# Try Claude CLI with authentication bypass for CI
|
||||||
|
if claude -p --dangerously-skip-permissions "$PROMPT" > /tmp/changelog.txt 2>/tmp/claude_error.txt; then
|
||||||
|
CHANGELOG=$(cat /tmp/changelog.txt)
|
||||||
|
echo "✅ Successfully generated changelog with Claude CLI"
|
||||||
|
else
|
||||||
|
echo "⚠️ Claude CLI failed, using fallback changelog generation"
|
||||||
|
cat /tmp/claude_error.txt || echo "No error details available"
|
||||||
|
|
||||||
|
# Fallback: Generate changelog from commit messages
|
||||||
|
CHANGELOG="## Changes
|
||||||
|
|
||||||
|
### 🔧 Improvements
|
||||||
|
$(echo "$COMMITS" | sed 's/^[a-f0-9]* /- /' | head -10)
|
||||||
|
|
||||||
|
*Note: This changelog was generated automatically from commit messages. For detailed AI-generated changelogs, Claude CLI authentication would be needed.*"
|
||||||
|
fi
|
||||||
|
|
||||||
# Check if changelog generation succeeded
|
# Check if changelog generation succeeded
|
||||||
if [ $? -ne 0 ] || [ -z "$CHANGELOG" ]; then
|
if [ -z "$CHANGELOG" ]; then
|
||||||
echo "❌ ERROR: Failed to generate changelog with Claude. Workflow cannot continue."
|
echo "❌ ERROR: Failed to generate any changelog. Workflow cannot continue."
|
||||||
echo "Debug info - Commits to analyze:"
|
echo "Debug info - Commits to analyze:"
|
||||||
echo "$COMMITS"
|
echo "$COMMITS"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "✅ Successfully generated changelog with Claude"
|
echo "✅ Changelog generation completed"
|
||||||
|
|
||||||
# Save changelog to output
|
# Save changelog to output
|
||||||
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
||||||
|
|||||||
Reference in New Issue
Block a user