diff --git a/base-action/action.yml b/base-action/action.yml index 5747c0a..c746a7d 100644 --- a/base-action/action.yml +++ b/base-action/action.yml @@ -124,7 +124,7 @@ runs: PATH_TO_CLAUDE_CODE_EXECUTABLE: ${{ inputs.path_to_claude_code_executable }} run: | if [ -z "$PATH_TO_CLAUDE_CODE_EXECUTABLE" ]; then - CLAUDE_CODE_VERSION="2.1.63" + CLAUDE_CODE_VERSION="2.1.69" echo "Installing Claude Code v${CLAUDE_CODE_VERSION}..." for attempt in 1 2 3; do echo "Installation attempt $attempt..." diff --git a/base-action/bun.lock b/base-action/bun.lock index 05a7a16..0190584 100644 --- a/base-action/bun.lock +++ b/base-action/bun.lock @@ -6,7 +6,7 @@ "name": "@anthropic-ai/claude-code-base-action", "dependencies": { "@actions/core": "^1.10.1", - "@anthropic-ai/claude-agent-sdk": "^0.2.63", + "@anthropic-ai/claude-agent-sdk": "^0.2.69", "shell-quote": "^1.8.3", }, "devDependencies": { @@ -27,7 +27,7 @@ "@actions/io": ["@actions/io@1.1.3", "", {}, "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="], - "@anthropic-ai/claude-agent-sdk": ["@anthropic-ai/claude-agent-sdk@0.2.63", "", { "optionalDependencies": { "@img/sharp-darwin-arm64": "^0.34.2", "@img/sharp-darwin-x64": "^0.34.2", "@img/sharp-linux-arm": "^0.34.2", "@img/sharp-linux-arm64": "^0.34.2", "@img/sharp-linux-x64": "^0.34.2", "@img/sharp-linuxmusl-arm64": "^0.34.2", "@img/sharp-linuxmusl-x64": "^0.34.2", "@img/sharp-win32-arm64": "^0.34.2", "@img/sharp-win32-x64": "^0.34.2" }, "peerDependencies": { "zod": "^4.0.0" } }, "sha512-ZNiaQb/v6xkbrGt3dtq5J0DGY+AaOhoehUyposa3msvlAlkTHWNGR+NhbCcTE0ML1U91xhPqMAAwZIUqrlkKyQ=="], + "@anthropic-ai/claude-agent-sdk": ["@anthropic-ai/claude-agent-sdk@0.2.69", "", { "optionalDependencies": { "@img/sharp-darwin-arm64": "^0.34.2", "@img/sharp-darwin-x64": "^0.34.2", "@img/sharp-linux-arm": "^0.34.2", "@img/sharp-linux-arm64": "^0.34.2", "@img/sharp-linux-x64": "^0.34.2", "@img/sharp-linuxmusl-arm64": "^0.34.2", "@img/sharp-linuxmusl-x64": "^0.34.2", "@img/sharp-win32-arm64": "^0.34.2", "@img/sharp-win32-x64": "^0.34.2" }, "peerDependencies": { "zod": "^4.0.0" } }, "sha512-d1ZadIwC5PUBMQRK4Y/EC/Fm9xv/nvZ4g0XXa+vC0p+vKOCxhf4USdVKjuDzPM0z0f2qqZZZdxMjFuwa7paKRA=="], "@fastify/busboy": ["@fastify/busboy@2.1.1", "", {}, "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA=="], diff --git a/base-action/package.json b/base-action/package.json index 658648b..3f1274d 100644 --- a/base-action/package.json +++ b/base-action/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@actions/core": "^1.10.1", - "@anthropic-ai/claude-agent-sdk": "^0.2.63", + "@anthropic-ai/claude-agent-sdk": "^0.2.69", "shell-quote": "^1.8.3" }, "devDependencies": { diff --git a/base-action/src/run-claude-sdk.ts b/base-action/src/run-claude-sdk.ts index fe923b9..bf3a0a4 100644 --- a/base-action/src/run-claude-sdk.ts +++ b/base-action/src/run-claude-sdk.ts @@ -119,7 +119,7 @@ function sanitizeSdkOutput( duration_ms: resultMsg.duration_ms, num_turns: resultMsg.num_turns, total_cost_usd: resultMsg.total_cost_usd, - permission_denials: resultMsg.permission_denials, + permission_denials_count: resultMsg.permission_denials?.length ?? 0, }, null, 2, diff --git a/bun.lock b/bun.lock index 76585a0..bed974d 100644 --- a/bun.lock +++ b/bun.lock @@ -7,7 +7,7 @@ "dependencies": { "@actions/core": "^1.10.1", "@actions/github": "^6.0.1", - "@anthropic-ai/claude-agent-sdk": "^0.2.63", + "@anthropic-ai/claude-agent-sdk": "^0.2.69", "@modelcontextprotocol/sdk": "^1.11.0", "@octokit/graphql": "^8.2.2", "@octokit/rest": "^21.1.1", @@ -37,7 +37,7 @@ "@actions/io": ["@actions/io@1.1.3", "", {}, "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="], - "@anthropic-ai/claude-agent-sdk": ["@anthropic-ai/claude-agent-sdk@0.2.63", "", { "optionalDependencies": { "@img/sharp-darwin-arm64": "^0.34.2", "@img/sharp-darwin-x64": "^0.34.2", "@img/sharp-linux-arm": "^0.34.2", "@img/sharp-linux-arm64": "^0.34.2", "@img/sharp-linux-x64": "^0.34.2", "@img/sharp-linuxmusl-arm64": "^0.34.2", "@img/sharp-linuxmusl-x64": "^0.34.2", "@img/sharp-win32-arm64": "^0.34.2", "@img/sharp-win32-x64": "^0.34.2" }, "peerDependencies": { "zod": "^4.0.0" } }, "sha512-ZNiaQb/v6xkbrGt3dtq5J0DGY+AaOhoehUyposa3msvlAlkTHWNGR+NhbCcTE0ML1U91xhPqMAAwZIUqrlkKyQ=="], + "@anthropic-ai/claude-agent-sdk": ["@anthropic-ai/claude-agent-sdk@0.2.69", "", { "optionalDependencies": { "@img/sharp-darwin-arm64": "^0.34.2", "@img/sharp-darwin-x64": "^0.34.2", "@img/sharp-linux-arm": "^0.34.2", "@img/sharp-linux-arm64": "^0.34.2", "@img/sharp-linux-x64": "^0.34.2", "@img/sharp-linuxmusl-arm64": "^0.34.2", "@img/sharp-linuxmusl-x64": "^0.34.2", "@img/sharp-win32-arm64": "^0.34.2", "@img/sharp-win32-x64": "^0.34.2" }, "peerDependencies": { "zod": "^4.0.0" } }, "sha512-d1ZadIwC5PUBMQRK4Y/EC/Fm9xv/nvZ4g0XXa+vC0p+vKOCxhf4USdVKjuDzPM0z0f2qqZZZdxMjFuwa7paKRA=="], "@fastify/busboy": ["@fastify/busboy@2.1.1", "", {}, "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA=="], diff --git a/package.json b/package.json index 820a681..4dcfa34 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "dependencies": { "@actions/core": "^1.10.1", "@actions/github": "^6.0.1", - "@anthropic-ai/claude-agent-sdk": "^0.2.63", + "@anthropic-ai/claude-agent-sdk": "^0.2.69", "@modelcontextprotocol/sdk": "^1.11.0", "@octokit/graphql": "^8.2.2", "@octokit/rest": "^21.1.1", diff --git a/scripts/gh.sh b/scripts/gh.sh index 6113a75..06c15c8 100755 --- a/scripts/gh.sh +++ b/scripts/gh.sh @@ -11,6 +11,15 @@ set -euo pipefail # ./scripts/gh.sh search issues "search query" --limit 10 # ./scripts/gh.sh label list --limit 100 +export GH_HOST=github.com + +REPO="${GH_REPO:-${GITHUB_REPOSITORY:-}}" +if [[ -z "$REPO" || "$REPO" == */*/* || "$REPO" != */* ]]; then + echo "Error: GH_REPO or GITHUB_REPOSITORY must be set to owner/repo format (e.g., GITHUB_REPOSITORY=anthropics/claude-code)" >&2 + exit 1 +fi +export GH_REPO="$REPO" + ALLOWED_FLAGS=(--comments --state --limit --label) FLAGS_WITH_VALUES=(--state --limit --label) @@ -21,6 +30,7 @@ case "$CMD" in "issue view"|"issue list"|"search issues"|"label list") ;; *) + echo "Error: only 'issue view', 'issue list', 'search issues', 'label list' are allowed (e.g., ./scripts/gh.sh issue view 123)" >&2 exit 1 ;; esac @@ -45,6 +55,7 @@ for arg in "$@"; do fi done if [[ "$matched" == false ]]; then + echo "Error: only --comments, --state, --limit, --label flags are allowed (e.g., ./scripts/gh.sh issue list --state open --limit 20)" >&2 exit 1 fi FLAGS+=("$arg") @@ -62,24 +73,24 @@ for arg in "$@"; do fi done -REPO="${GH_REPO:-${GITHUB_REPOSITORY:-}}" - if [[ "$CMD" == "search issues" ]]; then - if [[ -z "$REPO" ]]; then - exit 1 - fi QUERY="${POSITIONAL[0]:-}" QUERY_LOWER=$(echo "$QUERY" | tr '[:upper:]' '[:lower:]') if [[ "$QUERY_LOWER" == *"repo:"* || "$QUERY_LOWER" == *"org:"* || "$QUERY_LOWER" == *"user:"* ]]; then + echo "Error: search query must not contain repo:, org:, or user: qualifiers (e.g., ./scripts/gh.sh search issues \"bug report\" --limit 10)" >&2 exit 1 fi gh "$SUB1" "$SUB2" "$QUERY" --repo "$REPO" "${FLAGS[@]}" +elif [[ "$CMD" == "issue view" ]]; then + if [[ ${#POSITIONAL[@]} -ne 1 ]] || ! [[ "${POSITIONAL[0]}" =~ ^[0-9]+$ ]]; then + echo "Error: issue view requires exactly one numeric issue number (e.g., ./scripts/gh.sh issue view 123)" >&2 + exit 1 + fi + gh "$SUB1" "$SUB2" "${POSITIONAL[0]}" "${FLAGS[@]}" else - # Reject URLs in positional args to prevent cross-repo access - for pos in "${POSITIONAL[@]}"; do - if [[ "$pos" == http://* || "$pos" == https://* ]]; then - exit 1 - fi - done - gh "$SUB1" "$SUB2" "${POSITIONAL[@]}" "${FLAGS[@]}" + if [[ ${#POSITIONAL[@]} -ne 0 ]]; then + echo "Error: issue list and label list do not accept positional arguments (e.g., ./scripts/gh.sh issue list --state open, ./scripts/gh.sh label list --limit 100)" >&2 + exit 1 + fi + gh "$SUB1" "$SUB2" "${FLAGS[@]}" fi diff --git a/src/entrypoints/run.ts b/src/entrypoints/run.ts index 8eb9ca1..238b56d 100644 --- a/src/entrypoints/run.ts +++ b/src/entrypoints/run.ts @@ -54,7 +54,7 @@ async function installClaudeCode(): Promise { return; } - const claudeCodeVersion = "2.1.63"; + const claudeCodeVersion = "2.1.69"; console.log(`Installing Claude Code v${claudeCodeVersion}...`); // On musl/Alpine systems, the native binary may require a newer musl than