forked from kubernetes-sigs/kubespray
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (57 loc) · 2.35 KB
/
dependency-pull-request.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: Dependency create bump PR
on:
workflow_dispatch:
inputs:
component:
description: "Component to update"
required: true
current_version:
description: "Current version of the component"
required: true
latest_version:
description: "Latest version of the component"
required: true
jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: '**/dependency_requirements.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r scripts/dependency_requirements.txt
- name: Run version check to create version_diff.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python scripts/dependency_updater.py --ci-check --component ${{ github.event.inputs.component }}
- name: Update component version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python scripts/dependency_updater.py --component ${{ github.event.inputs.component }}
- name: Generate PR body
id: generate_pr_body
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pr_body=$(python scripts/generate_pr_body.py --component ${{ github.event.inputs.component }})
# Escape any special characters (e.g., newlines) for the GITHUB_OUTPUT
echo "pr_body<<EOF" >> $GITHUB_OUTPUT
echo "$pr_body" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
branch: "dependency-${{ github.event.inputs.component }}-${{ github.event.inputs.latest_version }}"
commit-message: "Bump ${{ github.event.inputs.component }} from ${{ github.event.inputs.current_version }} to ${{ github.event.inputs.latest_version }}"
title: "Bump ${{ github.event.inputs.component }} from ${{ github.event.inputs.current_version }} to ${{ github.event.inputs.latest_version }}"
body: ${{ steps.generate_pr_body.outputs.pr_body }}
labels: |
dependencies
release-note-none