-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #251 from UCD-SERG/version-check
adding version check for pull requests
- Loading branch information
Showing
2 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
name: Version increment check | ||
|
||
jobs: | ||
version-check: | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ github.token }} | ||
permissions: | ||
pull-requests: read | ||
|
||
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); \ | ||
stopifnot(working_version > compare_version); \ | ||
" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: serocalculator | ||
Type: Package | ||
Title: Estimating Infection Rates from Serological Data | ||
Version: 1.2.0.9000 | ||
Version: 1.2.0.9001 | ||
Authors@R: c( | ||
person(given = "Peter", family = "Teunis", email = "[email protected]", role = c("aut", "cph"), comment = "Author of the method and original code."), | ||
person(given = "Kristina", family = "Lai", email = "[email protected]", role = c("aut", "cre")), | ||
|