Hook dependency updates #171
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
| on: | |
| schedule: | |
| - cron: '50 8 1,15 * *' | |
| workflow_dispatch: | |
| name: Hook dependency updates | |
| jobs: | |
| hook-dependencies-update: | |
| runs-on: macos-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - name: install runtime dependencies | |
| run: Rscript -e "install.packages(c('renv', 'jsonlite'))" | |
| - name: update PPM URL | |
| run: Rscript inst/update-ppm-url.R | |
| - name: update dependency graph among packages | |
| run: Rscript inst/update-existing-hook-dependencies.R | |
| - name: update existing packages | |
| run: Rscript inst/update-dependency-graph-existing-packages.R | |
| - name: install pre-commit | |
| run: | | |
| brew install pipx | |
| pipx install pre-commit | |
| - name: auto-release | |
| run: Rscript -e 'source("renv/activate.R"); renv::restore(); renv::install("."); precommit:::auto_release()' | |
| - name: Create Pull Request | |
| id: cpr | |
| uses: peter-evans/create-pull-request@v7.0.7 | |
| with: | |
| token: ${{ secrets.PRECOMMIT_HOOK_DEPENDENCY_UPDATE }} | |
| commit-message: Update renv dependencies | |
| branch: hook-dependencies-update | |
| delete-branch: true | |
| assignees: lorenzwalthert | |
| title: 'Hook dependencies update' | |
| body: | | |
| This PR updates the hook dependencies in `renv.lock`, auto-generated by [create-pull-request][1]. Close and re-open this to trigger `on: pull_request` events to circumvent [limitation of GitHub actions](https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#push-pull-request-branches-to-a-fork). | |
| [1]: https://github.com/peter-evans/create-pull-request | |
| - name: Checkout PR head SHA | |
| if: steps.cpr.outputs['pull-request-operation'] != 'none' | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ steps.cpr.outputs['pull-request-head-sha'] }} | |
| fetch-depth: 0 # good practice if you need history | |
| - name: Push latest tag | |
| run: | | |
| Rscript -e "install.packages('desc')" | |
| TAG="v$(Rscript -e 'cat(as.character(desc::desc_get_version()))')" | |
| git tag $TAG | |
| git push origin $TAG |