Create new modeling round #4
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: Create new modeling round | |
| on: | |
| schedule: | |
| - cron: "0 10 * * 1" # Monday mornings | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| create-modeling-round: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Generate Installation Token | |
| id: get_token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ vars.GH_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| sparse-checkout: | | |
| auxiliary-data/ | |
| hub-config/ | |
| src/ | |
| - name: Setup R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| install-r: true | |
| use-public-rspm: true | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libcurl4-openssl-dev | |
| - name: Install dependencies | |
| run: | | |
| install.packages(c("lubridate", "argparser", "remotes", "cli", "hubUtils")) | |
| remotes::install_github("hubverse-org/hubAdmin") | |
| remotes::install_github('cdcgov/forecasttools') | |
| shell: Rscript {0} | |
| - name: create-round-and-update-hub-config | |
| run: | | |
| Rscript src/make_round_config.R | |
| - name: Commit changes | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| message: "Add a new modeling round" | |
| default_author: github_actions | |
| push: true | |
| new_branch: add-round | |
| - name: Create pull request | |
| id: create_pr | |
| run: | | |
| gh pr create --base main --head add-round --title "Add a modeling round" --body "This PR is generated automatically." | |
| env: | |
| GH_TOKEN: ${{ steps.get_token.outputs.token }} |