-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
67 lines (61 loc) · 1.99 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
name: "Update Python Poetry packages"
author: "@Apakottur"
description: "Create a PR that updates Python packages to latest possible versions, based on Poetry configuration files"
branding:
icon: chevrons-up
color: purple
inputs:
python-version:
description: "Python version for the updater"
required: false
default: "3.11"
poetry-version:
description: "Poetry version for the updater"
required: false
default: "1.5.1"
base-branch:
description: "Git branch on which the updater is run"
required: false
default: "main"
pr-body:
description: "The body of the pull request"
required: false
default:
"Automated changes by [update-python-poetry-packages](https://github.com/Apakottur/action-poetry-package-update)
GitHub action"
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.base-branch }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: Install Poetry
run: pip install poetry==${{ inputs.poetry-version }}
shell: bash
- name: Install Python dependencies
run: poetry install --no-dev
working-directory: ${{ github.action_path }}
shell: bash
- name: Update Python Poetry packages
run: poetry run src/main.py --paths ${{ github.workspace }}
working-directory: ${{ github.action_path }}
shell: bash
- name: Check if there are changes
id: changes
run: echo "::set-output name=changed::$(git status --porcelain | wc -l)"
shell: bash
- name: Create a PR with the updates
if: steps.changes.outputs.changed > 0
uses: peter-evans/create-pull-request@v4
with:
commit-message: Update Python packages
branch: automated/package-updates
branch-suffix: timestamp
delete-branch: true
title: Update Python packages
body: ${{ inputs.pr-body }}
base: ${{ inputs.base-branch }}