mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-01-24 15:34:13 +08:00
Compare commits
22 Commits
v0.0.34
...
ashwin/tes
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d909172ebf | ||
|
|
b04be4e195 | ||
|
|
c23800108f | ||
|
|
23b54ce0d2 | ||
|
|
ed1e708634 | ||
|
|
37f5543283 | ||
|
|
533ec5356f | ||
|
|
f1e95926d6 | ||
|
|
e5b28393c7 | ||
|
|
168e891554 | ||
|
|
7673148cfb | ||
|
|
af74c779a5 | ||
|
|
2877ea975e | ||
|
|
c61f7b0167 | ||
|
|
b16ea06ada | ||
|
|
1eab4a208c | ||
|
|
b938e69075 | ||
|
|
ba5d64171b | ||
|
|
5b3ce5ec6d | ||
|
|
c6e906e3ba | ||
|
|
dbf69fe645 | ||
|
|
b49014e105 |
7
.github/workflows/claude.yml
vendored
7
.github/workflows/claude.yml
vendored
@@ -31,9 +31,14 @@ jobs:
|
||||
|
||||
- name: Run Claude Code
|
||||
id: claude
|
||||
uses: anthropics/claude-code-action@beta
|
||||
uses: ./
|
||||
with:
|
||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
allowed_tools: "Bash(bun install),Bash(bun test:*),Bash(bun run format),Bash(bun typecheck)"
|
||||
custom_instructions: "You have also been granted tools for editing files and running bun commands (install, run, test, typecheck) for testing your changes: bun install, bun test, bun run format, bun typecheck."
|
||||
model: "claude-opus-4-20250514"
|
||||
# Test network restrictions
|
||||
allowed_domains: |
|
||||
.anthropic.com
|
||||
.github.com
|
||||
.githubusercontent.com
|
||||
|
||||
@@ -185,7 +185,7 @@ runs:
|
||||
- name: Run Claude Code
|
||||
id: claude-code
|
||||
if: steps.prepare.outputs.contains_trigger == 'true'
|
||||
uses: anthropics/claude-code-base-action@03e2a2d6923a9187c8e93b04ef2f8dae3219d0b1 # v0.0.36
|
||||
uses: anthropics/claude-code-base-action@503cc7080e62d63d2cc1d80035ed04617d5efb47 # v0.0.35
|
||||
with:
|
||||
prompt_file: ${{ runner.temp }}/claude-prompts/claude-prompt.txt
|
||||
allowed_tools: ${{ env.ALLOWED_TOOLS }}
|
||||
|
||||
@@ -21,13 +21,6 @@ export async function configureGitAuth(
|
||||
) {
|
||||
console.log("Configuring git authentication for non-signing mode");
|
||||
|
||||
// Determine the noreply email domain based on GITHUB_SERVER_URL
|
||||
const serverUrl = new URL(GITHUB_SERVER_URL);
|
||||
const noreplyDomain =
|
||||
serverUrl.hostname === "github.com"
|
||||
? "users.noreply.github.com"
|
||||
: `users.noreply.${serverUrl.hostname}`;
|
||||
|
||||
// Configure git user based on the comment creator
|
||||
console.log("Configuring git user...");
|
||||
if (user) {
|
||||
@@ -35,12 +28,12 @@ export async function configureGitAuth(
|
||||
const botId = user.id;
|
||||
console.log(`Setting git user as ${botName}...`);
|
||||
await $`git config user.name "${botName}"`;
|
||||
await $`git config user.email "${botId}+${botName}@${noreplyDomain}"`;
|
||||
await $`git config user.email "${botId}+${botName}@users.noreply.github.com"`;
|
||||
console.log(`✓ Set git user as ${botName}`);
|
||||
} else {
|
||||
console.log("No user data in comment, using default bot user");
|
||||
await $`git config user.name "github-actions[bot]"`;
|
||||
await $`git config user.email "41898282+github-actions[bot]@${noreplyDomain}"`;
|
||||
await $`git config user.email "41898282+github-actions[bot]@users.noreply.github.com"`;
|
||||
}
|
||||
|
||||
// Remove the authorization header that actions/checkout sets
|
||||
@@ -54,6 +47,7 @@ export async function configureGitAuth(
|
||||
|
||||
// Update the remote URL to include the token for authentication
|
||||
console.log("Updating remote URL with authentication...");
|
||||
const serverUrl = new URL(GITHUB_SERVER_URL);
|
||||
const remoteUrl = `https://x-access-token:${githubToken}@${serverUrl.host}/${context.repository.owner}/${context.repository.repo}.git`;
|
||||
await $`git remote set-url origin ${remoteUrl}`;
|
||||
console.log("✓ Updated remote URL with authentication token");
|
||||
|
||||
Reference in New Issue
Block a user