Skip to content

Add Workflow For Authorized User Checking Via Hubhelpr #257

Add Workflow For Authorized User Checking Via Hubhelpr

Add Workflow For Authorized User Checking Via Hubhelpr #257

name: "Hub Submission Validation (R)"
on:
workflow_dispatch:
pull_request:
branches: main
jobs:
validate-submission:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Checkout Code"
uses: actions/checkout@v5
- uses: r-lib/actions/setup-r@v2
with:
install-r: true
use-public-rspm: true
extra-repositories: 'https://hubverse-org.r-universe.dev'
- name: "Update R"
run: |
sudo apt-get update
- uses: r-lib/actions/setup-r-dependencies@v2
with:
pak-version: "devel"
packages: |
any::hubValidations
any::sessioninfo
- name: "Get Model Output Changes"
id: get_changed_files_in_model_output
uses: step-security/changed-files@v46
with:
path: model-output
dir_names: "true"
- name: "Check Modified Output Directories"
run: |
if [ "${{ steps.get_changed_files_in_model_output.outputs.all_modified_files }}" == "RSVHub-ensemble" ]; then
{ echo "model=ensemble" | tee -a $GITHUB_ENV; }
else
{ echo "model=other" | tee -a $GITHUB_ENV; }
fi
- name: "Run Validations"
env:
PR_NUMBER: ${{ github.event.number }}
run: |
library("hubValidations")
v <- hubValidations::validate_pr(
gh_repo = Sys.getenv("GITHUB_REPOSITORY"),
pr_number = Sys.getenv("PR_NUMBER"),
skip_submit_window_check = Sys.getenv("model") == "ensemble"
)
hubValidations::check_for_errors(v, verbose = TRUE)
shell: Rscript {0}