File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
actions/claude-code-action Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ inputs:
1212runs :
1313 using : " docker"
1414 image : " ghcr.io/mervinpraison/praisonai-claudecode:latest"
15+ env :
16+ ANTHROPIC_API_KEY : ${{ inputs.anthropic_api_key }}
17+ GITHUB_TOKEN : ${{ inputs.github_token }}
1518 args :
1619 - " --anthropic-api-key=${{ inputs.anthropic_api_key }}"
1720 - " --github-token=${{ inputs.github_token }}"
Original file line number Diff line number Diff line change @@ -7,9 +7,15 @@ echo "Running Claude Code in CI mode..."
77# Extract GitHub context and create a smart prompt
88PROMPT=" Analyse the GitHub issue or PR context and generate a smart response based on the repository context."
99
10- # Set environment variables
11- export ANTHROPIC_API_KEY=" $1 "
12- export GITHUB_TOKEN=" $2 "
10+ # Set environment variables from arguments
11+ export ANTHROPIC_API_KEY=" ${1# --anthropic-api-key=} "
12+ export GITHUB_TOKEN=" ${2# --github-token=} "
13+
14+ # Verify environment variables
15+ if [ -z " $ANTHROPIC_API_KEY " ] || [ -z " $GITHUB_TOKEN " ]; then
16+ echo " Error: Required environment variables are not set"
17+ exit 1
18+ fi
1319
1420# Run Claude with the prompt
1521claude -p " $PROMPT "
Original file line number Diff line number Diff line change @@ -30,11 +30,14 @@ jobs:
3030 with :
3131 fetch-depth : 1
3232
33+ - name : Set up Docker Buildx
34+ uses : docker/setup-buildx-action@v3
35+
3336 - name : Login to GitHub Container Registry
3437 uses : docker/login-action@v3
3538 with :
3639 registry : ghcr.io
37- username : ${{ github.actor }}
40+ username : MervinPraison
3841 password : ${{ secrets.GH_TOKEN }}
3942
4043 - name : Run Claude Code
You can’t perform that action at this time.
0 commit comments