announce skipped snapshot files #840
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# adapted from https://github.com/RMI-PACTA/actions/blob/main/.github/workflows/R-semver-check.yml | |
on: | |
pull_request: | |
branches: | |
- main | |
name: Version increment check | |
jobs: | |
version-check: | |
if: ${{ github.event_name == 'pull_request' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout working HEAD | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
sparse-checkout: | | |
DESCRIPTION | |
path: working | |
- name: checkout base HEAD | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.base.ref }} | |
sparse-checkout: | | |
DESCRIPTION | |
path: compare | |
- name: show files | |
run: | | |
ls -lR working compare | |
echo "\nWORKING:\n" | |
cat working/DESCRIPTION | |
echo "\nCOMPARE:\n" | |
cat compare/DESCRIPTION | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: compare versions | |
run: | | |
Rscript -e " \ | |
install.packages('desc'); \ | |
working_version <- desc::desc_get_version('working/DESCRIPTION'); \ | |
message('PR branch version: ', working_version); \ | |
compare_version <- desc::desc_get_version('compare/DESCRIPTION'); \ | |
message('main branch version: ', compare_version); \ | |
if (working_version <= compare_version) { \ | |
message('Call usethis::use_version() in the R Console to increment the "dev" version number.'); \ | |
stopifnot(working_version > compare_version); \ | |
} else message('All set!'); \ | |
" |