Skip to content

Commit 6c9eb69

Browse files
authored
Merge pull request #1480 from Anselmoo/feature/automatic-poetry-bot
feat: 👷 Add an automatic poetry update workflow
2 parents 1117613 + 964f462 commit 6c9eb69

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Weekly Poetry Update
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 0' # Runs every Sunday at midnight
6+
7+
jobs:
8+
update-dependencies:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: '3.10'
19+
20+
- name: Install Poetry
21+
run: |
22+
curl -sSL https://install.python-poetry.org | python3 -
23+
export PATH="$HOME/.local/bin:$PATH"
24+
25+
- name: Install dependencies
26+
run: poetry install
27+
28+
- name: Update dependencies
29+
run: poetry update
30+
31+
- name: Create new branch
32+
run: |
33+
git config --global user.name 'github-actions[bot]'
34+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
35+
git checkout -b update-dependencies-$(date +%Y%m%d)
36+
git add .
37+
git commit -m "chore(deps): :arrows_counterclockwise: update dependencies $(date +%Y%m%d)"
38+
git push origin update-dependencies-$(date +%Y%m%d)
39+
40+
- name: Create Pull Request
41+
id: create_pr
42+
uses: peter-evans/create-pull-request@v5
43+
with:
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
branch: update-dependencies-$(date +%Y%m%d)
46+
title: "chore(deps): :arrows_counterclockwise: update dependencies $(date +%Y%m%d)"
47+
body: "This PR updates dependencies to their latest versions."
48+
labels: dependencies
49+
assignees: ${{ github.actor }}
50+
51+
- name: Enable auto-merge
52+
uses: pascalgn/automerge-action@v0
53+
with:
54+
token: ${{ secrets.GITHUB_TOKEN }}
55+
pull-request: ${{ steps.create_pr.outputs.pull-request-number }}
56+
merge-method: squash

0 commit comments

Comments
 (0)