Skip to content

Commit d8fa58e

Browse files
authored
Docs: tip about extra-packages workflow_dispatch input (#977)
1 parent 61d5d05 commit d8fa58e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

setup-r-dependencies/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,33 @@ to install an embedded test package you can write:
217217
...
218218
```
219219

220+
## Installing specific versions of dependencies
221+
222+
If you want to run a workflow with specific versions of R package
223+
dependencies, one good way to do that is adding these package versions
224+
to `extra-packages`. If you regularly do this, you could modify your
225+
workflow file to add an `extra-packages` input to `workflow_dispatch`:
226+
227+
```yaml
228+
workflow_dispatch:
229+
inputs:
230+
extra-packages:
231+
description: 'extra package to install for the runs (like a dev version of one of the deps) - comma separated'
232+
required: false
233+
type: string
234+
```
235+
236+
```yaml
237+
- uses: r-lib/actions/setup-r-dependencies@v2
238+
with:
239+
extra-packages: >
240+
any::rcmdcheck,
241+
${{ github.event.inputs.extra-packages }}
242+
needs: check
243+
```
244+
245+
(Cf. https://github.com/r-lib/actions/issues/958#issue-2775898508.)
246+
220247
## System dependencies
221248

222249
pak automatically install the system dependencies of all installed R

0 commit comments

Comments
 (0)