Install dev version of a required package in GitHub Actions

I am the maintainer of two packages on GitHub:


I'm setting up GitHub Actions to run CMD CHECK when changes are pushed to GitHub. I would like to run CMD CHECK when I push on the development branches (9000 branch) in each project. The problem is that the 9000 branch of phenoptrReports requires the 9000 branch of phenoptr. Is there a way I can code the action file for phenoptrReports to install the correct version of phenoptr?

In essence, if the phenoptrReports action is running because of a push to the 9000 branch, I would like to run
remotes::install_github('akoyabio/phenoptr@9000')
before installing the other dependencies.

Thanks for any help!
Kent Johnson
Akoya Biosciences

I'm getting closer...the full ref of the branch is available in the environment as GITHUB_REF . I can't figure out how to use this in install_github. I've tried
remotes::install_github("akoyabio/phenoptr", ref="${{ env.GITHUB_REF }}")
which gave me an empty string, and
remotes::install_github("akoyabio/phenoptr", ref="${GITHUB_REF}")
remotes::install_github("akoyabio/phenoptr", ref="$GITHUB_REF")
which inserted the literal strings $%7BGITHUB_REF%7D and $GITHUB_REF
remotes::install_github("akoyabio/phenoptr", ref="${{GITHUB_REF}}")
gives an error: Unrecognized named-value: 'GITHUB_REF'. Located at position 1 within expression: GITHUB_REF

The GitHub Actions docs don't have a clear example of referencing a built-in environment variable and the examples I find from searching are inconsistent.

I got it working...here is what worked:

          remotes::install_github("akoyabio/phenoptr", ref="${{github.ref}}")
          remotes::install_deps(dependencies = TRUE, upgrade="never")

I found github.ref in a forum, I don't see that in the official docs at all. The first line installs the correct version of the dependency; the upgrade="never" in the second line prevents overwriting the package installed in the first line with the incorrect one.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.