-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
84 lines (71 loc) · 2.34 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
name: '🏗 Create a PR updating a python library of a repository'
description: 'Tool for managing your Python libraries across multiple repositories.'
branding:
icon: 'box'
color: 'yellow'
inputs:
library:
description: 'The name of the library'
required: true
new_version:
description: 'The new version to update to'
required: true
repository:
description: 'The repository full name where to create the PR'
required: true
branch:
description: 'The branch where to create the PR to'
required: true
python_version:
description: 'The python version used on the repository'
required: true
pat:
description: 'Github Personal token REPO scope'
required: true
ssh_private_key:
description: 'SSH key to pull libraries'
required: false
default: ''
ssh_library_url:
description: 'SSH url from the library to pull'
required: false
default: ''
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: ${{ inputs.repository }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}
- name: Setup Poetry
uses: snok/install-poetry@v1
- name: Prepare SSH Key
if: ${{ inputs.ssh_private_key != '' }}
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ inputs.ssh_private_key }}
- name: Update library
if: ${{ inputs.ssh_private_key == '' }}
shell: bash
run: |
poetry remove ${{ inputs.library }}
poetry add ${{ inputs.library }}==${{ inputs.new_version }}
- name: Update SSH library
if: ${{ inputs.ssh_private_key != '' }}
shell: bash
run: |
poetry remove ${{ inputs.library }}
poetry add ${{ inputs.ssh_library_url }}
- name: Create pull request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ inputs.pat }}
branch: 'update-${{ inputs.library }}-to-${{ inputs.new_version }}'
commit-message: 'Update ${{ inputs.library }} to ${{ inputs.new_version }} version'
title: 'Update ${{ inputs.library }} to ${{ inputs.new_version }} version'
body: 'This PR updates the ${{ inputs.library }} to ${{ inputs.new_version }} version.'
base: ${{ inputs.branch }}