-
Notifications
You must be signed in to change notification settings - Fork 24
44 lines (42 loc) · 1.43 KB
/
poetry_update.yml
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
name: Poetry update
on:
workflow_dispatch:
schedule:
- cron: '10 2 * * 3'
jobs:
poetry-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Update setuptools
run: python -m pip install --upgrade pip setuptools
- name: Install poetry dependencies
run: |
poetry install --with dev || poetry install --with dev || echo "No dev dependency group"
- name: Setup git
run: |
git config --global user.name "Poetry updater"
git config --global user.email "actions@users.noreply.github.com"
git config --global url.https://github.com/.insteadOf git://github.com/
- name: Set branch name
run: |
echo "BRANCH_NAME=poetry_update" >> $GITHUB_ENV
echo ${{ env.BRANCH_NAME }}
- name: Switch to branch ${{ env.BRANCH_NAME }}
run: |
git checkout -b ${{ env.BRANCH_NAME }}
- name: Run poetry update
run: |
poetry update
git add .
git commit -m 'update dependencies'
git push --set-upstream origin ${{ env.BRANCH_NAME }}
- name: Create pull request
uses: repo-sync/pull-request@v2
with:
source_branch: "${{ env.BRANCH_NAME }}"
destination_branch: "main"
pr_title: "Poetry update"
github_token: ${{ secrets.GITHUB_TOKEN }}