actions icon indicating copy to clipboard operation
actions copied to clipboard

Github action syntax unclear

Open edmondop opened this issue 2 years ago • 4 comments

The documentation for the R Check action suggests to use the error-on:


Run r-lib/actions/check-r-package@v[2](https://github.com/.../5593775315?check_suite_focus=true#step:7:2)
  with:
    error-on: error
    args: c("--no-manual", "--as-cran")
    build_args: "--no-manual"
    check-dir: "check"
    working-directory: .
    upload-snapshots: false
    upload-results: false
  env:
    GITHUB_PAT: ***
    R_KEEP_PKG_SOURCE: yes
    R_LIBS_USER: /home/runner/work/_temp/Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true
    RSPM: https://packagemanager.rstudio.com/all/__linux__/focal/latest
Run ## --------------------------------------------------------------------
Error in match.arg(error_on, c("never", "error", "warning", "note")) : 
  object 'error' not found

I tried a couple of possible setups:


      - uses: r-lib/actions/check-r-package@v2
        with:
          error-on: "error"

I also tried with no quotes. What's happening there? Do I need to escape the string in the yml? Looks like a bug in the parsing on the action side

edmondop avatar Mar 18 '22 00:03 edmondop

Well the documentation says:

It must be an R expression in single quotes.

So the correct form is

      - uses: r-lib/actions/check-r-package@v2
        with:
          error-on: '"error"'

gaborcsardi avatar Mar 18 '22 08:03 gaborcsardi

I just encountered a similar problem. While I can, sort of, agree to warp into additional quotes arguments that are passed to R function (though it feels like it should be handled by the action itself), I am confused by the difference in syntax and naming of two paths https://github.com/r-lib/actions/blob/8e8f7edba0e5bda9318f9377c0dc9c2f5d0fb786/check-r-package/action.yaml#L14-L19

It will certainly create less... problems and issues if R actions have syntax, consistent with other (e.g., non-R) actions.

Ilia-Kosenkov avatar Jun 02 '22 08:06 Ilia-Kosenkov

Changing the syntax is breaking change, so we cannot do that now. We can certainly document it better, which is what this issue is about.

gaborcsardi avatar Jun 02 '22 08:06 gaborcsardi

Well the documentation says:

It must be an R expression in single quotes.

So the correct form is

      - uses: r-lib/actions/check-r-package@v2
        with:
          error-on: '"error"'

As I point out in issue #579, this is a correct form, but there are others. For example,

      - uses: r-lib/actions/check-r-package@v2
        with:
          error-on: "\"error\""

or, considering the fact that in R, "error" and c("error") are equivalent,

      - uses: r-lib/actions/check-r-package@v2
        with:
          error-on: c("error")

(no extra quotes needed).

So to say "it must be an R expression in single quotes" is a bit of an overstatement and not quite true.

gsrohde avatar Jun 17 '22 01:06 gsrohde

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue

github-actions[bot] avatar Nov 04 '22 13:11 github-actions[bot]