Sync Template #246
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
name: Sync Template | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 2 * * *" # every night at 2:00 UTC | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
# for now, pin cookiecutter version, due to https://github.com/cruft/cruft/issues/166 | |
run: python -m pip install --upgrade cruft "cookiecutter<2" pre-commit toml | |
- name: Find Latest Tag | |
uses: oprypin/find-latest-tag@v1.1.0 | |
id: get-latest-tag | |
with: | |
repository: scverse/cookiecutter-scverse | |
releases-only: false | |
sort-tags: true | |
regex: '^v\d+\.\d+\.\d+$' # vX.X.X | |
- name: Sync | |
run: | | |
cruft update --checkout ${{ steps.get-latest-tag.outputs.tag }} --skip-apply-ask --project-dir . | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
commit-message: Automated template update from cookiecutter-scverse | |
branch: template-update | |
title: Automated template update from cookiecutter-scverse | |
body: | | |
A new version of the [scverse cookiecutter template](https://github.com/scverse/cookiecutter-scverse/releases) | |
got released. This PR adds all new changes to your repository and helps to to stay in sync with | |
the latest best-practice template maintained by the scverse team. | |
**If a merge conflict arised, a `.rej` file with the rejected patch is generated. You'll need to | |
manually merge these changes.** | |
For more information about the template sync, please refer to the | |
[template documentation](https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#automated-template-sync). |