-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 2.04 KB
/
pypackage_check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: template update check
on:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *" # Run at 00:00 on the first day of each month
jobs:
check_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: install dependencies
run: pip install requests
- name: get latest pypackage release
id: get_latest_release
run: |
RELEASE=$(curl -s https://api.github.com/repos/12rambau/pypackage/releases | jq -r '.[0].tag_name')
echo "latest=$RELEASE" >> $GITHUB_OUTPUT
echo "latest release: $RELEASE"
- name: get current pypackage version
id: get_current_version
run: |
RELEASE=$(yq -r "._commit" .copier-answers.yml)
echo "current=$RELEASE" >> $GITHUB_OUTPUT
echo "current release: $RELEASE"
- name: open issue
if: steps.get_current_version.outputs.current != steps.get_latest_release.outputs.latest
uses: rishabhgupta/git-action-issue@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Update template to ${{ steps.get_latest_release.outputs.latest }}"
body: |
The package is based on the ${{ steps.get_current_version.outputs.current }} version of [@12rambau/pypackage](https://github.com/12rambau/pypackage).
The latest version of the template is ${{ steps.get_latest_release.outputs.latest }}.
Please consider updating the template to the latest version to include all the latest developments.
Run the following code in your project directory to update the template:
```
copier update --trust --defaults --vcs-ref ${{ steps.get_latest_release.outputs.latest }}
```
> **Note**
> You may need to reinstall ``copier`` and ``jinja2-time`` if they are not available in your environment.
After solving the merging issues you can push back the changes to your main branch.