Skip to content

Commit 3ffaa84

Browse files
authored
Fix: Correct secrets access in reusable workflow (#3)
In reusable workflows (workflow_call), secrets need to be checked with != '' syntax, not just using && boolean logic. Also removed the unnecessary if condition on the Claude step since ANTHROPIC_API_KEY is required. Co-authored-by: jaysonv0341 <jaysonv0341@users.noreply.github.com>
1 parent 72f36c6 commit 3ffaa84

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

.github/workflows/claude-review.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@ jobs:
4444
# (Optional) Generate a GitHub App token for better commenting behavior
4545
- name: Generate GitHub App token
4646
id: app-token
47-
if: ${{ secrets.APP_ID && secrets.APP_PRIVATE_KEY }}
47+
if: ${{ secrets.APP_ID != '' && secrets.APP_PRIVATE_KEY != '' }}
4848
uses: actions/create-github-app-token@v2
4949
with:
5050
app-id: ${{ secrets.APP_ID }}
5151
private-key: ${{ secrets.APP_PRIVATE_KEY }}
5252

5353

5454
- name: Run Claude via Anthropic API
55-
if: ${{ secrets.ANTHROPIC_API_KEY != '' }}
5655
uses: anthropics/claude-code-action-official@v1
5756
with:
5857
github_token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)