add baseline forecasts #22
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
| name: "Hub Config Validation (R)" | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: main | |
| paths: | |
| - "hub-config/**" | |
| - "!**README**" | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| validate-hub-config: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| PR_NUMBER: ${{ github.event.number }} | |
| HUB_PATH: ${{ github.workspace }} | |
| steps: | |
| - 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" | |
| cache: "always" | |
| packages: | | |
| any::hubAdmin | |
| any::sessioninfo | |
| - name: "Run Validations" | |
| id: validate | |
| run: hubAdmin::ci_validate_hub_config(diff = "${{ runner.temp }}/diff.md") | |
| shell: Rscript {0} | |
| - name: "Comment On PR" | |
| id: comment-diff | |
| if: ${{ github.event_name != 'workflow_dispatch' }} | |
| uses: carpentries/actions/comment-diff@main | |
| with: | |
| pr: ${{ env.PR_NUMBER }} | |
| path: ${{ runner.temp }}/diff.md | |
| - name: "Error On Failure" | |
| if: ${{ steps.validate.outputs.result == 'false' }} | |
| run: | | |
| echo "::error title=Invalid Configuration::Errors were detected in one or more config files in 'hub-config/'" | |
| exit 1 |