nmfs-fish-tools / ghactions4r

Reusable github actions workflows for R packages
https://nmfs-fish-tools.github.io/ghactions4r/
12 stars 1 forks source link

[Bug]: pull_request committing on a pull request build trigger doesn't work for doc-and-style #137

Open k-doering-NOAA opened 2 months ago

k-doering-NOAA commented 2 months ago

Describe the bug

From @iantaylor-NOAA :

The changes was made after I messed up the workflow by naively having it apply to pull requests (which would have required an extra pull-request to the pull request). See also https://github.com/nmfs-fish-tools/ghactions4r/issues/135 and discussion here: https://github.com/NOAA-FIMS/FIMS/issues/660.

To Reproduce

  1. Run in an R package: ghactions4r::use_doc_and_style_r(how_to_commit = "pull_request", build_trigger = "pull_request") and push the workflow to github.

  2. Try creating a branch, make a change that requires styling, and opening a pull request.

  3. The workflow will error

Expected behavior

A pull request opens to the branch.

Another option if we don't want to support this workflow is to have use_doc_and_style_r() error with a helpful message if someone tries to set up a workflow with options how_to_commit = "pull_request", build_trigger = "pull_request"

Screenshots

No response

Which OS are you seeing the problem on?

No response

Which browser are you seeing the problem on?

No response

Which version of ghactions4r are you seeing the problem on?

No response

Additional Context

No response

k-doering-NOAA commented 2 months ago

Added an error msg, but lieaving this open in case we actually want to make the option work.