|
21 | 21 | permissions: |
22 | 22 | contents: read |
23 | 23 | pull-requests: write |
24 | | - issues: read |
| 24 | + issues: write # so Claude can open follow-up issues for deferred work |
25 | 25 | id-token: write |
26 | 26 | actions: read # Required for Claude to read CI results on PRs |
27 | 27 | steps: |
|
30 | 30 | with: |
31 | 31 | fetch-depth: 1 |
32 | 32 |
|
| 33 | + # R toolchain so Claude can run common package-maintenance commands |
| 34 | + # (e.g. devtools::document(), styler::style_pkg(), pkgdown builds, |
| 35 | + # spelling::spell_check_package(), lintr, R CMD check). |
| 36 | + # Adds ~1–3 min when the dependency cache is warm; the first run after |
| 37 | + # a lockfile change is slower. JAGS is required because `runjags` is in |
| 38 | + # Imports and load-all/document needs the package to be loadable. |
| 39 | + # System libs mirror copilot-setup-steps.yml so packages that source- |
| 40 | + # build (textshaping, ragg, curl, xml2, ...) don't fail unpredictably. |
| 41 | + - name: Install system dependencies (Ubuntu) |
| 42 | + run: | |
| 43 | + sudo apt-get update |
| 44 | + sudo apt-get install -y \ |
| 45 | + jags \ |
| 46 | + libcurl4-openssl-dev \ |
| 47 | + libssl-dev \ |
| 48 | + libxml2-dev \ |
| 49 | + libfontconfig1-dev \ |
| 50 | + libharfbuzz-dev \ |
| 51 | + libfribidi-dev \ |
| 52 | + libfreetype6-dev \ |
| 53 | + libpng-dev \ |
| 54 | + libtiff5-dev \ |
| 55 | + libjpeg-dev |
| 56 | +
|
| 57 | + - uses: r-lib/actions/setup-pandoc@v2 |
| 58 | + |
| 59 | + - uses: r-lib/actions/setup-r@v2 |
| 60 | + with: |
| 61 | + use-public-rspm: true |
| 62 | + |
| 63 | + - uses: r-lib/actions/setup-r-dependencies@v2 |
| 64 | + with: |
| 65 | + extra-packages: | |
| 66 | + any::devtools |
| 67 | + any::roxygen2 |
| 68 | + any::rjags |
| 69 | + any::rmarkdown |
| 70 | + any::lintr |
| 71 | + any::spelling |
| 72 | + any::rcmdcheck |
| 73 | + needs: check |
| 74 | + |
33 | 75 | - name: Resolve PR number (if any) |
34 | 76 | id: pr |
35 | 77 | env: |
@@ -86,10 +128,12 @@ jobs: |
86 | 128 | # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it. |
87 | 129 | # prompt: 'Update the pull request description to include a summary of changes.' |
88 | 130 |
|
89 | | - # Optional: Add claude_args to customize behavior and configuration |
90 | | - # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md |
91 | | - # or https://code.claude.com/docs/en/cli-reference for available options |
92 | | - # claude_args: '--allowed-tools Bash(gh pr *)' |
| 131 | + # Extend the Bash allowlist so Claude can: |
| 132 | + # * run package-maintenance R commands (devtools::document(), |
| 133 | + # styler::style_pkg(), R CMD ...) — toolchain is installed above; |
| 134 | + # * file follow-up issues for work deferred out of the current PR |
| 135 | + # (gh issue create / comment / edit / view / list). |
| 136 | + claude_args: '--allowed-tools "Bash(Rscript:*)" "Bash(R:*)" "Bash(R CMD:*)" "Bash(gh issue:*)"' |
93 | 137 |
|
94 | 138 | - name: Re-assign reviewers after Claude finishes |
95 | 139 | if: always() && steps.stash.outcome == 'success' && steps.pr.outputs.number != '' |
|
0 commit comments