Skip to content

Commit e7913e2

Browse files
committed
fix: add checkout step and tool permissions to claude-code-action workflows
This commit fixes two issues in the pr-assignment-check and pr-stale-check workflows: 1. Added actions/checkout@v4 step with fetch-depth: 0 - Agent mode requires a git repository to configure git settings - Fixes "fatal: not in a git directory" error - Allows Claude to access repository files and use git commands 2. Added allowed_tools: "Bash,Read,Grep,Glob" - Enables Claude to run gh commands and examine PR/issue content - Previously Claude was being blocked from using Bash tool - Required for workflows to function correctly Changes based on claude-code-action documentation which shows that agent mode (triggered by providing a prompt) needs repository access.
1 parent df61c5c commit e7913e2

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
## Summary
2+
23
[One sentence: what this PR does]
34

45
## Changes
6+
57
- [Key change 1]
68
- [Key change 2]
79

810
## Testing
11+
912
**Business logic tests added:**
13+
1014
- [ ] [Describe test 1 - what behavior it validates]
1115
- [ ] [Describe test 2 - what edge case it covers]
1216
- [ ] All tests pass locally
1317

1418
## Visuals
19+
1520
**Required for UI/UX changes:**
21+
1622
- [ ] Before/after screenshots attached
1723
- [ ] Video demo for interactions (< 30s)
1824

1925
## Checklist
26+
2027
- [ ] Changeset added (if version bump needed)
2128
- [ ] Tests cover business logic (not just happy path)
2229
- [ ] No breaking changes (or documented below)

.github/workflows/pr-assignment-check.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77
inputs:
88
pr_number:
9-
description: 'PR number to check'
9+
description: "PR number to check"
1010
required: true
1111
type: number
1212

@@ -19,10 +19,14 @@ jobs:
1919
pull-requests: write
2020
id-token: write
2121
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
2225
- uses: anthropics/claude-code-action@v1
2326
with:
2427
anthropic_api_key: ${{ secrets.CLAUDE_CODE_API_KEY }}
2528
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
allowed_tools: "Bash,Read,Grep,Glob"
2630
prompt: |
2731
EXEMPT USERS: @maxprilutskiy, @vrcprl, @davidturnbull, @monicabe, @sumitsaurabh927, @AleksandrSl (skip all checks if PR author is one of these)
2832

.github/workflows/pr-stale-check.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: PR Stale Check
22

33
on:
44
schedule:
5-
- cron: '0 0 * * 1' # Every Monday at midnight UTC
5+
- cron: "0 0 * * 1" # Every Monday at midnight UTC
66
workflow_dispatch:
77

88
jobs:
@@ -14,10 +14,14 @@ jobs:
1414
pull-requests: write
1515
id-token: write
1616
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
1720
- uses: anthropics/claude-code-action@v1
1821
with:
1922
anthropic_api_key: ${{ secrets.CLAUDE_CODE_API_KEY }}
2023
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
allowed_tools: "Bash,Read,Grep,Glob"
2125
prompt: |
2226
EXEMPT USERS: @maxprilutskiy, @vrcprl, @davidturnbull, @monicabe, @sumitsaurabh927, @AleksandrSl
2327

0 commit comments

Comments
 (0)