Skip to content

Commit ebd4882

Browse files
committed
ci: support gitea secrets fallback
1 parent 5bcd15c commit ebd4882

File tree

8 files changed

+26
-13
lines changed

8 files changed

+26
-13
lines changed

.github/workflows/claude-review.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ jobs:
2929
- Documentation consistency: Verify that README.md and other documentation files are updated to reflect any code changes (especially new inputs, features, or configuration options)
3030
3131
Be constructive and specific in your feedback. Give inline comments where applicable.
32-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
32+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
33+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}
3334
allowed_tools: "mcp__github__create_pending_pull_request_review,mcp__github__add_pull_request_review_comment_to_pending_review,mcp__github__submit_pending_pull_request_review,mcp__github__get_pull_request_diff"

.github/workflows/claude.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ jobs:
3333
id: claude
3434
uses: anthropics/claude-code-action@beta
3535
with:
36-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
36+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
37+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}
3738
allowed_tools: "Bash(bun install),Bash(bun test:*),Bash(bun run format),Bash(bun typecheck)"
3839
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."
3940
model: "claude-opus-4-20250514"

.github/workflows/issue-triage.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,5 @@ jobs:
103103
allowed_tools: "Bash(gh label list),mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue,mcp__github__search_issues,mcp__github__list_issues"
104104
mcp_config: /tmp/mcp-config/mcp-servers.json
105105
timeout_minutes: "5"
106-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
106+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
107+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}

.github/workflows/test-base-action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ jobs:
2323
uses: ./base-action
2424
with:
2525
prompt: ${{ github.event.inputs.test_prompt || 'List the files in the current directory starting with "package"' }}
26-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
26+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
27+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}
2728
allowed_tools: "LS,Read"
2829
timeout_minutes: "3"
2930

@@ -81,7 +82,8 @@ jobs:
8182
uses: ./base-action
8283
with:
8384
prompt_file: "test-prompt.txt"
84-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
85+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
86+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}
8587
allowed_tools: "LS,Read"
8688
timeout_minutes: "3"
8789

.github/workflows/test-claude-env.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
with:
2020
prompt: |
2121
Use the Bash tool to run: echo "VAR1: $VAR1" && echo "VAR2: $VAR2"
22-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
22+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
23+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}
2324
claude_env: |
2425
# This is a comment
2526
VAR1: value1

.github/workflows/test-custom-executables.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ jobs:
4949
with:
5050
prompt: |
5151
List the files in the current directory starting with "package"
52-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
52+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
53+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}
5354
path_to_claude_code_executable: /home/runner/.local/bin/claude
5455
path_to_bun_executable: /home/runner/.bun/bin/bun
5556
allowed_tools: "LS,Read"

.github/workflows/test-mcp-servers.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ jobs:
2828
id: claude-test
2929
with:
3030
prompt: "List all available tools"
31-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
31+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
32+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}
3233
env:
3334
# Change to test directory so it finds .mcp.json
3435
CLAUDE_WORKING_DIR: ${{ github.workspace }}/base-action/test/mcp-test
@@ -109,7 +110,8 @@ jobs:
109110
id: claude-config-test
110111
with:
111112
prompt: "List all available tools"
112-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
113+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
114+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}
113115
mcp_config: '{"mcpServers":{"test-server":{"type":"stdio","command":"bun","args":["simple-mcp-server.ts"],"env":{}}}}'
114116
env:
115117
# Change to test directory so bun can find the MCP server script

.github/workflows/test-settings.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
with:
2020
prompt: |
2121
Use Bash to echo "Hello from settings test"
22-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
22+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
23+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}
2324
settings: |
2425
{
2526
"permissions": {
@@ -69,7 +70,8 @@ jobs:
6970
with:
7071
prompt: |
7172
Use Bash to echo "This should not work"
72-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
73+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
74+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}
7375
settings: |
7476
{
7577
"permissions": {
@@ -112,7 +114,8 @@ jobs:
112114
with:
113115
prompt: |
114116
Use Bash to echo "Hello from settings file test"
115-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
117+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
118+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}
116119
settings: "test-settings.json"
117120
timeout_minutes: "2"
118121

@@ -167,7 +170,8 @@ jobs:
167170
with:
168171
prompt: |
169172
Use Bash to echo "This should not work from file"
170-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
173+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY && secrets.ANTHROPIC_API_KEY || secrets.CLAUDE_CREDENTIALS }}
174+
claude_code_oauth_token: ${{ secrets.CLAUDE_CREDENTIALS }}
171175
settings: "test-settings.json"
172176
timeout_minutes: "2"
173177

0 commit comments

Comments
 (0)