-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (51 loc) · 1.34 KB
/
update_deps.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Update deps
on:
push:
branches:
main
schedule:
- cron: "0 0 * * *"
jobs:
update_dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pdm
uses: pdm-project/setup-pdm@v4
- name: "Update dependencies"
run: |
pdm install
echo 'SUMMARY<<EOF' >> $GITHUB_OUTPUT
pdm update >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
shell: bash
id: pdm-update
- id: detect-changes
shell: bash
run: |
if [[ `git status --porcelain` ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.detect-changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit-message: "[CI] Auto update dependencies"
sign-commits: true
branch: action/update-deps
delete-branch: true
title: "[CI] Update dependencies"
body: |
## Update summary
```shell
${{ steps.pdm-update.outputs.SUMMARY }}
```
*Auto-generated by dependencies update action*
labels: |
automated pr
draft: false