Skip to content

Commit 0278577

Browse files
Update claude setup and instructions
* Allow claude to use cargo * Instruct it to format code before committing
1 parent 1fa2684 commit 0278577

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/claude.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,20 @@ jobs:
2222
contents: read
2323
pull-requests: read
2424
issues: read
25+
actions: read
2526
id-token: write
26-
actions: read # Required for Claude to read CI results on PRs
2727
steps:
2828
- name: Checkout repository
2929
uses: actions/checkout@v5
3030
with:
3131
fetch-depth: 1
3232

33+
- name: Install Rust toolchain
34+
uses: dtolnay/rust-toolchain@0f44b27771c32bda9f458f75a1e241b09791b331
35+
with:
36+
toolchain: "1.89.0"
37+
components: rustfmt
38+
3339
- name: Run Claude Code
3440
id: claude
3541
uses: anthropics/claude-code-action@v1
@@ -39,12 +45,11 @@ jobs:
3945
# This is an optional setting that allows Claude to read CI results on PRs
4046
additional_permissions: |
4147
actions: read
48+
contents: write
49+
pull-requests: write
4250
4351
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
4452
# prompt: 'Update the pull request description to include a summary of changes.'
4553

46-
# Optional: Add claude_args to customize behavior and configuration
47-
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48-
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
49-
# claude_args: '--allowed-tools Bash(gh pr:*)'
50-
54+
# Allow Claude to create PRs and run cargo and git commands
55+
claude_args: '--allowed-tools Bash(gh pr:*) Bash(cargo add:*) Bash(cargo fmt:*) Bash(cargo check:*) Bash(git:*)'

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* Before creating commit, always run `cargo fmt`
2+
* When possible, keep PRs to one commit only; amend existing commit when making changes to PRs, and force push

0 commit comments

Comments
 (0)