|
| 1 | +name: Sync Template |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + - cron: "0 2 * * *" # every night at 2:00 UTC |
| 7 | + |
| 8 | +jobs: |
| 9 | + sync: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v2 |
| 13 | + - name: Set up Python 3.10 |
| 14 | + uses: actions/setup-python@v4 |
| 15 | + with: |
| 16 | + python-version: "3.10" |
| 17 | + - name: Install dependencies |
| 18 | + # for now, pin cookiecutter version, due to https://github.com/cruft/cruft/issues/166 |
| 19 | + run: python -m pip install --upgrade cruft "cookiecutter<2" pre-commit toml |
| 20 | + - name: Find Latest Tag |
| 21 | + uses: oprypin/find-latest-tag@v1.1.0 |
| 22 | + id: get-latest-tag |
| 23 | + with: |
| 24 | + repository: scverse/cookiecutter-scverse |
| 25 | + releases-only: false |
| 26 | + sort-tags: true |
| 27 | + regex: '^v\d+\.\d+\.\d+$' # vX.X.X |
| 28 | + - name: Sync |
| 29 | + run: | |
| 30 | + cruft update --checkout ${{ steps.get-latest-tag.outputs.tag }} --skip-apply-ask --project-dir . |
| 31 | + - name: Create Pull Request |
| 32 | + uses: peter-evans/create-pull-request@v4 |
| 33 | + with: |
| 34 | + commit-message: Automated template update from cookiecutter-scverse |
| 35 | + branch: template-update |
| 36 | + title: Automated template update from cookiecutter-scverse |
| 37 | + body: | |
| 38 | + A new version of the [scverse cookiecutter template](https://github.com/scverse/cookiecutter-scverse/releases) |
| 39 | + got released. This PR adds all new changes to your repository and helps to to stay in sync with |
| 40 | + the latest best-practice template maintained by the scverse team. |
| 41 | +
|
| 42 | + **If a merge conflict arised, a `.rej` file with the rejected patch is generated. You'll need to |
| 43 | + manually merge these changes.** |
| 44 | +
|
| 45 | + For more information about the template sync, please refer to the |
| 46 | + [template documentation](https://cookiecutter-scverse-instance.readthedocs.io/en/latest/developer_docs.html#automated-template-sync). |
0 commit comments