Skip to content

Commit

Permalink
[setup-r-dependencies]: upgrade parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Feb 7, 2023
1 parent 33f03a8 commit ac4564f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions setup-r-dependencies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Inputs available
by newlines or commas.
- `pak-version`: Which pak version to use. Possible values are
`stable`, `rc` and `devel`. Defaults to `stable`.
- `upgrade`: Whether to install the latest available versions of the
dependencies. Must be an R expression. See the README for details if
you need quoting. Defaults to `FALSE`.
- `working-directory` - default `'.'`. If the DESCRIPTION file is not in the
root directory of your repository.

Expand Down
4 changes: 4 additions & 0 deletions setup-r-dependencies/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ inputs:
dependencies:
description: 'Types of dependencies to install. Must be an R expression. Note that it often needs to be quoted in YAML, see the README for details.'
default: '"all"'
upgrade:
description: 'Whether to install the latest available versions of the dependencies. Must be an R expression. See the README for details if you need quoting.'
default: 'FALSE'
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -88,6 +91,7 @@ runs:
pak::lockfile_create(
c(deps, extra_deps),
lockfile = ".github/pkg.lock",
upgrade = (${{ inputs.upgrade }}),
dependencies = c(needs, (${{ inputs.dependencies }}))
)
cat("::endgroup::\n")
Expand Down

3 comments on commit ac4564f

@pascalgulikers
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When setting the upgrade input parameter to 'TRUE', (${{ inputs.upgrade }}) resolves to (true) and is throwing the following error:

Error in rs_call(self, private, func, args, package) :
object 'true' not found
Calls: ... -> rs_run_with_output -> -> rs_call
Execution halted
Error: Process completed with exit code 1.

@gaborcsardi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you show an example?

@gaborcsardi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, try setting it to

upgrade: '"TRUE"'

Please sign in to comment.