mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-24 07:24:12 +08:00
Compare commits
1 Commits
claude/sla
...
fix/instal
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99b6199758 |
13
action.yml
13
action.yml
@@ -202,6 +202,10 @@ runs:
|
|||||||
echo "Installing Claude Code v${CLAUDE_CODE_VERSION}..."
|
echo "Installing Claude Code v${CLAUDE_CODE_VERSION}..."
|
||||||
for attempt in 1 2 3; do
|
for attempt in 1 2 3; do
|
||||||
echo "Installation attempt $attempt..."
|
echo "Installation attempt $attempt..."
|
||||||
|
|
||||||
|
# Clean up stale lock files before retry
|
||||||
|
rm -rf ~/.claude/.locks 2>/dev/null || true
|
||||||
|
|
||||||
if command -v timeout &> /dev/null; then
|
if command -v timeout &> /dev/null; then
|
||||||
timeout 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break
|
timeout 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break
|
||||||
else
|
else
|
||||||
@@ -214,8 +218,15 @@ runs:
|
|||||||
echo "Installation failed, retrying..."
|
echo "Installation failed, retrying..."
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
echo "Claude Code installed successfully"
|
|
||||||
|
# Add to PATH and validate installation
|
||||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
if ! command -v claude &> /dev/null; then
|
||||||
|
echo "Installation failed: claude binary not found in PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Claude Code installed successfully"
|
||||||
else
|
else
|
||||||
echo "Using custom Claude Code executable: $PATH_TO_CLAUDE_CODE_EXECUTABLE"
|
echo "Using custom Claude Code executable: $PATH_TO_CLAUDE_CODE_EXECUTABLE"
|
||||||
# Add the directory containing the custom executable to PATH
|
# Add the directory containing the custom executable to PATH
|
||||||
|
|||||||
@@ -128,6 +128,10 @@ runs:
|
|||||||
echo "Installing Claude Code v${CLAUDE_CODE_VERSION}..."
|
echo "Installing Claude Code v${CLAUDE_CODE_VERSION}..."
|
||||||
for attempt in 1 2 3; do
|
for attempt in 1 2 3; do
|
||||||
echo "Installation attempt $attempt..."
|
echo "Installation attempt $attempt..."
|
||||||
|
|
||||||
|
# Clean up stale lock files before retry
|
||||||
|
rm -rf ~/.claude/.locks 2>/dev/null || true
|
||||||
|
|
||||||
if command -v timeout &> /dev/null; then
|
if command -v timeout &> /dev/null; then
|
||||||
timeout 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break
|
timeout 120 bash -c "curl -fsSL https://claude.ai/install.sh | bash -s -- $CLAUDE_CODE_VERSION" && break
|
||||||
else
|
else
|
||||||
@@ -140,6 +144,14 @@ runs:
|
|||||||
echo "Installation failed, retrying..."
|
echo "Installation failed, retrying..."
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Add to PATH and validate installation
|
||||||
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
if ! command -v claude &> /dev/null; then
|
||||||
|
echo "Installation failed: claude binary not found in PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo "Claude Code installed successfully"
|
echo "Claude Code installed successfully"
|
||||||
else
|
else
|
||||||
echo "Using custom Claude Code executable: $PATH_TO_CLAUDE_CODE_EXECUTABLE"
|
echo "Using custom Claude Code executable: $PATH_TO_CLAUDE_CODE_EXECUTABLE"
|
||||||
|
|||||||
@@ -563,22 +563,9 @@ ${getCommitInstructions(eventData, githubData, context, useCommitSigning)}
|
|||||||
${
|
${
|
||||||
eventData.claudeBranch
|
eventData.claudeBranch
|
||||||
? `
|
? `
|
||||||
When done with changes:
|
When done with changes, provide a PR link:
|
||||||
1. Run git log origin/${eventData.baseBranch}..HEAD and git diff origin/${eventData.baseBranch}...HEAD to understand ALL commits
|
|
||||||
2. Draft a PR summary analyzing ALL changes (not just the latest commit)
|
|
||||||
3. Provide a PR link:
|
|
||||||
[Create a PR](${GITHUB_SERVER_URL}/${context.repository}/compare/${eventData.baseBranch}...${eventData.claudeBranch}?quick_pull=1&title=<url-encoded-title>&body=<url-encoded-body>)
|
[Create a PR](${GITHUB_SERVER_URL}/${context.repository}/compare/${eventData.baseBranch}...${eventData.claudeBranch}?quick_pull=1&title=<url-encoded-title>&body=<url-encoded-body>)
|
||||||
Use THREE dots (...) between branches. URL-encode all parameters.
|
Use THREE dots (...) between branches. URL-encode all parameters.`
|
||||||
PR body format:
|
|
||||||
## Summary
|
|
||||||
<1-3 bullet points>
|
|
||||||
|
|
||||||
## Test plan
|
|
||||||
<Checklist of testing TODOs>
|
|
||||||
|
|
||||||
Fixes #<issue-number>
|
|
||||||
|
|
||||||
Generated with [Claude Code](https://claude.ai/code)`
|
|
||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -756,13 +743,8 @@ ${eventData.eventName === "issue_comment" || eventData.eventName === "pull_reque
|
|||||||
- Mark each subtask as completed as you progress.${getCommitInstructions(eventData, githubData, context, useCommitSigning)}
|
- Mark each subtask as completed as you progress.${getCommitInstructions(eventData, githubData, context, useCommitSigning)}
|
||||||
${
|
${
|
||||||
eventData.claudeBranch
|
eventData.claudeBranch
|
||||||
? `- When creating a pull request, follow these steps:
|
? `- Provide a URL to create a PR manually in this format:
|
||||||
1. Use git log and git diff to understand the full commit history for the current branch (from the time it diverged from the base branch):
|
[Create a PR](${GITHUB_SERVER_URL}/${context.repository}/compare/${eventData.baseBranch}...<branch-name>?quick_pull=1&title=<url-encoded-title>&body=<url-encoded-body>)
|
||||||
- Run: git log origin/${eventData.baseBranch}..HEAD
|
|
||||||
- Run: git diff origin/${eventData.baseBranch}...HEAD
|
|
||||||
2. Analyze ALL changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request), and draft a pull request summary
|
|
||||||
3. Provide a URL to create a PR manually in this format:
|
|
||||||
[Create a PR](${GITHUB_SERVER_URL}/${context.repository}/compare/${eventData.baseBranch}...<branch-name>?quick_pull=1&title=<url-encoded-title>&body=<url-encoded-body>)
|
|
||||||
- IMPORTANT: Use THREE dots (...) between branch names, not two (..)
|
- IMPORTANT: Use THREE dots (...) between branch names, not two (..)
|
||||||
Example: ${GITHUB_SERVER_URL}/${context.repository}/compare/main...feature-branch (correct)
|
Example: ${GITHUB_SERVER_URL}/${context.repository}/compare/main...feature-branch (correct)
|
||||||
NOT: ${GITHUB_SERVER_URL}/${context.repository}/compare/main..feature-branch (incorrect)
|
NOT: ${GITHUB_SERVER_URL}/${context.repository}/compare/main..feature-branch (incorrect)
|
||||||
@@ -770,16 +752,10 @@ ${eventData.eventName === "issue_comment" || eventData.eventName === "pull_reque
|
|||||||
Example: Instead of "fix: update welcome message", use "fix%3A%20update%20welcome%20message"
|
Example: Instead of "fix: update welcome message", use "fix%3A%20update%20welcome%20message"
|
||||||
- The target-branch should be '${eventData.baseBranch}'.
|
- The target-branch should be '${eventData.baseBranch}'.
|
||||||
- The branch-name is the current branch: ${eventData.claudeBranch}
|
- The branch-name is the current branch: ${eventData.claudeBranch}
|
||||||
- The PR body MUST follow this format:
|
- The body should include:
|
||||||
## Summary
|
- A clear description of the changes
|
||||||
<1-3 bullet points summarizing the changes>
|
- Reference to the original ${eventData.isPR ? "PR" : "issue"}
|
||||||
|
- The signature: "Generated with [Claude Code](https://claude.ai/code)"
|
||||||
## Test plan
|
|
||||||
<Bulleted markdown checklist of TODOs for testing the pull request>
|
|
||||||
|
|
||||||
Fixes #<issue-number>
|
|
||||||
|
|
||||||
Generated with [Claude Code](https://claude.ai/code)
|
|
||||||
- Just include the markdown link with text "Create a PR" - do not add explanatory text before it like "You can create a PR using this link"`
|
- Just include the markdown link with text "Create a PR" - do not add explanatory text before it like "You can create a PR using this link"`
|
||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user