mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-23 23:14:13 +08:00
Compare commits
4 Commits
ashwin/mod
...
v0.0.40
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93df09fd88 | ||
|
|
d290268f83 | ||
|
|
d69f61e377 | ||
|
|
de86beb3ae |
@@ -193,7 +193,8 @@ runs:
|
|||||||
# Run the base-action
|
# Run the base-action
|
||||||
cd ${GITHUB_ACTION_PATH}/base-action
|
cd ${GITHUB_ACTION_PATH}/base-action
|
||||||
bun install
|
bun install
|
||||||
bun run src/index.ts
|
cd -
|
||||||
|
bun run ${GITHUB_ACTION_PATH}/base-action/src/index.ts
|
||||||
env:
|
env:
|
||||||
# Base-action inputs
|
# Base-action inputs
|
||||||
CLAUDE_CODE_ACTION: "1"
|
CLAUDE_CODE_ACTION: "1"
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ async function run() {
|
|||||||
appendSystemPrompt: process.env.INPUT_APPEND_SYSTEM_PROMPT,
|
appendSystemPrompt: process.env.INPUT_APPEND_SYSTEM_PROMPT,
|
||||||
claudeEnv: process.env.INPUT_CLAUDE_ENV,
|
claudeEnv: process.env.INPUT_CLAUDE_ENV,
|
||||||
fallbackModel: process.env.INPUT_FALLBACK_MODEL,
|
fallbackModel: process.env.INPUT_FALLBACK_MODEL,
|
||||||
|
model: process.env.ANTHROPIC_MODEL,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(`Action failed with error: ${error}`);
|
core.setFailed(`Action failed with error: ${error}`);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export type ClaudeOptions = {
|
|||||||
claudeEnv?: string;
|
claudeEnv?: string;
|
||||||
fallbackModel?: string;
|
fallbackModel?: string;
|
||||||
timeoutMinutes?: string;
|
timeoutMinutes?: string;
|
||||||
|
model?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type PreparedConfig = {
|
type PreparedConfig = {
|
||||||
@@ -94,6 +95,9 @@ export function prepareRunConfig(
|
|||||||
if (options.fallbackModel) {
|
if (options.fallbackModel) {
|
||||||
claudeArgs.push("--fallback-model", options.fallbackModel);
|
claudeArgs.push("--fallback-model", options.fallbackModel);
|
||||||
}
|
}
|
||||||
|
if (options.model) {
|
||||||
|
claudeArgs.push("--model", options.model);
|
||||||
|
}
|
||||||
if (options.timeoutMinutes) {
|
if (options.timeoutMinutes) {
|
||||||
const timeoutMinutesNum = parseInt(options.timeoutMinutes, 10);
|
const timeoutMinutesNum = parseInt(options.timeoutMinutes, 10);
|
||||||
if (isNaN(timeoutMinutesNum) || timeoutMinutesNum <= 0) {
|
if (isNaN(timeoutMinutesNum) || timeoutMinutesNum <= 0) {
|
||||||
|
|||||||
@@ -694,8 +694,7 @@ What You CANNOT Do:
|
|||||||
- Submit formal GitHub PR reviews
|
- Submit formal GitHub PR reviews
|
||||||
- Approve pull requests (for security reasons)
|
- Approve pull requests (for security reasons)
|
||||||
- Post multiple comments (you only update your initial comment)
|
- Post multiple comments (you only update your initial comment)
|
||||||
- Execute commands outside the repository context
|
- Execute commands outside the repository context${useCommitSigning ? "\n- Run arbitrary Bash commands (unless explicitly allowed via allowed_tools configuration)" : ""}
|
||||||
- Run arbitrary Bash commands (unless explicitly allowed via allowed_tools configuration)
|
|
||||||
- Perform branch operations (cannot merge branches, rebase, or perform other git operations beyond pushing commits)
|
- Perform branch operations (cannot merge branches, rebase, or perform other git operations beyond pushing commits)
|
||||||
- Modify files in the .github/workflows directory (GitHub App permissions do not allow workflow modifications)
|
- Modify files in the .github/workflows directory (GitHub App permissions do not allow workflow modifications)
|
||||||
- View CI/CD results or workflow run outputs (cannot access GitHub Actions logs or test results)
|
- View CI/CD results or workflow run outputs (cannot access GitHub Actions logs or test results)
|
||||||
|
|||||||
@@ -116,6 +116,11 @@ export async function setupBranch(
|
|||||||
`Branch name generated: ${newBranch} (will be created by file ops server on first commit)`,
|
`Branch name generated: ${newBranch} (will be created by file ops server on first commit)`,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Ensure we're on the source branch
|
||||||
|
console.log(`Fetching and checking out source branch: ${sourceBranch}`);
|
||||||
|
await $`git fetch origin ${sourceBranch} --depth=1`;
|
||||||
|
await $`git checkout ${sourceBranch}`;
|
||||||
|
|
||||||
// Set outputs for GitHub Actions
|
// Set outputs for GitHub Actions
|
||||||
core.setOutput("CLAUDE_BRANCH", newBranch);
|
core.setOutput("CLAUDE_BRANCH", newBranch);
|
||||||
core.setOutput("BASE_BRANCH", sourceBranch);
|
core.setOutput("BASE_BRANCH", sourceBranch);
|
||||||
@@ -131,7 +136,12 @@ export async function setupBranch(
|
|||||||
`Creating local branch ${newBranch} for ${entityType} #${entityNumber} from source branch: ${sourceBranch}...`,
|
`Creating local branch ${newBranch} for ${entityType} #${entityNumber} from source branch: ${sourceBranch}...`,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Create and checkout the new branch locally
|
// Fetch and checkout the source branch first to ensure we branch from the correct base
|
||||||
|
console.log(`Fetching and checking out source branch: ${sourceBranch}`);
|
||||||
|
await $`git fetch origin ${sourceBranch} --depth=1`;
|
||||||
|
await $`git checkout ${sourceBranch}`;
|
||||||
|
|
||||||
|
// Create and checkout the new branch from the source branch
|
||||||
await $`git checkout -b ${newBranch}`;
|
await $`git checkout -b ${newBranch}`;
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
Reference in New Issue
Block a user