-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
action.yml
93 lines (82 loc) · 2.58 KB
/
action.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: "PDM update dependencies"
description: "Update the pdm.lock file"
inputs:
token:
description: "A personal access token"
required: false
default: ${{ github.token }}
commit-message:
description: "The commit message"
required: false
default: "chore: Update pdm.lock"
pr-title:
description: "The PR title"
required: false
default: "chore: Update pdm.lock"
update-strategy:
description: "The update strategy, can be 'reuse', 'eager' or 'all'"
required: false
default: "reuse"
save-strategy:
description: "The save strategy, can be 'compatible', 'wildcard', 'exact' or 'minimum'"
required: false
default: "minimum"
unconstrained:
description: "Ignore the version constraint of packages in pyproject.toml"
required: false
default: "false"
install-plugins:
description: "Whether install PDM plugins before update"
required: false
default: "false"
sign-off-commit:
description: "Whether commit message contains signed-off-by"
required: false
default: "false"
runs:
using: "composite"
steps:
- uses: pdm-project/setup-pdm@v4
- name: Install the action plugin
run: pdm self add ${{ github.action_path }}
shell: bash
- name: Install plugins
if: inputs.install-plugins == 'true'
run: pdm install --plugins
shell: bash
- name: "Update dependencies"
run: pdm update --no-sync --update-${{ inputs.update-strategy }} --save-${{ inputs.save-strategy }} ${{ inputs.unconstrained == 'true' && '--unconstrained' || '' }}
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: ${{ inputs.token }}
with:
token: ${{ inputs.token }}
commit-message: ${{ inputs.commit-message }}
signoff: ${{ inputs.sign-off-commit }}
branch: dep/update-pdm-lock
delete-branch: true
title: ${{ inputs.pr-title }}
body: |
Update locked dependencies.
## Update summary
${{ steps.pdm-update.outputs.SUMMARY }}
*Auto-generated by [PDM update action][1]*
[1]: https://github.com/pdm-project/update-deps-action
labels: |
automated pr
draft: false
branding:
icon: "code"
color: "green"