-
Notifications
You must be signed in to change notification settings - Fork 6
188 lines (158 loc) · 7.24 KB
/
chart-update.yaml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
---
name: "chart-update"
on:
schedule:
- cron: "0 7 * * 1-5"
workflow_dispatch:
inputs:
update-strategy:
description: "Update strategy to use. Valid values are 'patch', 'minor' or 'major'"
type: choice
options:
- "patch"
- "minor"
- "major"
required: true
excluded-dependencies:
description: "Comma-separated list of dependencies to exclude from the update (i.e. 'dependency1,dependency2,dependency3')"
type: string
required: false
default: ""
dry-run:
description: "Activate dry-run mode"
type: boolean
required: false
default: true
# Define global settings for all the steps.
env:
author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
# The duplication of code between the two steps is not ideal, but we did not find a way to reuse the centralized
# workflow or by using a strategy matrix to workaround the problem.
jobs:
chart-update-schedule:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'schedule' }}
strategy:
matrix:
update-strategy: ["minor", "major"]
steps:
- name: "Check out the repository"
uses: actions/checkout@v4
- name: "Upgrade Helm chart dependencies"
id: deps-update
uses: camptocamp/[email protected]
with:
chart-path: "charts/argocd"
readme-path: "README.adoc"
update-strategy: "${{ matrix.update-strategy }}"
- name: "Extract the Chart.yaml file from the upgraded chart"
if: ${{ steps.deps-update.outputs.update-type != 'none' }}
run: |
tar -zxvf charts/argocd/charts/argo-cd-*.tgz argo-cd/Chart.yaml
mv argo-cd/Chart.yaml chart-version.yaml
rm -r argo-cd
- name: "Create Pull Request for a minor/patch update"
if: ${{ steps.deps-update.outputs.update-type != 'none' && steps.deps-update.outputs.update-type != 'major' }}
id: minor-pr
uses: peter-evans/create-pull-request@v7
env:
pr-title: "feat(chart): ${{ steps.deps-update.outputs.update-type }} update of dependencies on argocd chart"
branch: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}-argocd"
labels: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}"
with:
commit-message: ${{ env.pr-title }}
author: ${{ env.author }}
committer: ${{ env.author }}
branch: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}-argocd"
title: ${{ env.pr-title }}
labels: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}"
body: |
:robot: I have updated the chart *beep* *boop*
---
## Description of the changes
This PR updates the dependencies of the **argocd** Helm chart.
The maximum version bump was a **${{ steps.deps-update.outputs.update-type }}** step.
- name: "Create Pull Request for a major update"
if: ${{ steps.deps-update.outputs.update-type != 'none' && steps.deps-update.outputs.update-type == 'major' }}
id: major-pr
uses: peter-evans/create-pull-request@v7
env:
# This step does not have a branch and labels environment variable, because it is forcefully a major update,
# unlike the previous step, which can either be a patch, minor or major update.
pr-title: "feat(chart)!: major update of dependencies on argocd chart"
with:
commit-message: ${{ env.pr-title }}
author: ${{ env.author }}
committer: ${{ env.author }}
branch: "chart-autoupdate-major-argocd"
title: ${{ env.pr-title }}
labels: "chart-autoupdate-major"
body: |
:robot: I have updated the chart *beep* *boop*
---
## Description of the changes
This PR updates the dependencies of the **argocd** Helm chart.
:warning: This was a **major** update! Please check the changelog of the updated dependencies and **take notice of any breaking changes before merging**. :warning:
chart-update-manual:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' }}
steps:
- name: "Check out the repository"
uses: actions/checkout@v4
- name: "Upgrade Helm chart dependencies"
id: deps-update
uses: camptocamp/[email protected]
with:
chart-path: "charts/argocd"
readme-path: "README.adoc"
excluded-dependencies: ${{ inputs.excluded-dependencies }}
update-strategy: "${{ inputs.update-strategy }}"
dry-run: "${{ inputs.dry-run }}"
- name: "Extract the Chart.yaml file from the upgraded chart"
if: ${{ steps.deps-update.outputs.update-type != 'none' }}
run: |
tar -zxvf charts/argocd/charts/argo-cd-*.tgz argo-cd/Chart.yaml
mv argo-cd/Chart.yaml chart-version.yaml
rm -r argo-cd
- name: "Create Pull Request for a minor/patch update"
if: ${{ !inputs.dry-run && steps.deps-update.outputs.update-type != 'none' && steps.deps-update.outputs.update-type != 'major' }}
id: minor-pr
uses: peter-evans/create-pull-request@v7
env:
pr-title: "feat(chart): ${{ steps.deps-update.outputs.update-type }} update of dependencies on argocd chart"
branch: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}-argocd"
labels: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}"
with:
commit-message: ${{ env.pr-title }}
author: ${{ env.author }}
committer: ${{ env.author }}
branch: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}-argocd"
title: ${{ env.pr-title }}
labels: "chart-autoupdate-${{ steps.deps-update.outputs.update-type }}"
body: |
:robot: I have updated the chart *beep* *boop*
---
## Description of the changes
This PR updates the dependencies of the **argocd** Helm chart.
The maximum version bump was a **${{ steps.deps-update.outputs.update-type }}** step.
- name: "Create Pull Request for a major update"
if: ${{ !inputs.dry-run && steps.deps-update.outputs.update-type != 'none' && steps.deps-update.outputs.update-type == 'major' }}
id: major-pr
uses: peter-evans/create-pull-request@v7
env:
# This step does not have a branch and labels environment variable, because it is forcefully a major update,
# unlike the previous step, which can either be a patch, minor or major update.
pr-title: "feat(chart)!: major update of dependencies on argocd chart"
with:
commit-message: ${{ env.pr-title }}
author: ${{ env.author }}
committer: ${{ env.author }}
branch: "chart-autoupdate-major-argocd"
title: ${{ env.pr-title }}
labels: "chart-autoupdate-major"
body: |
:robot: I have updated the chart *beep* *boop*
---
## Description of the changes
This PR updates the dependencies of the **argocd** Helm chart.
:warning: This was a **major** update! Please check the changelog of the updated dependencies and **take notice of any breaking changes before merging**. :warning: