-
Notifications
You must be signed in to change notification settings - Fork 151
87 lines (78 loc) · 3.88 KB
/
update_chart_dependencies.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
name: Check for new chart dependency updates
# Description:
# This workflow automates the process of checking for and updating Helm chart dependencies.
# Specifically, it:
# 1. Checks for new versions of (subchart) dependencies listed in chart.yaml.
# 2. Updates chart.yaml with new versions where applicable.
# 3. If the 'opentelemetry-operator' subchart is updated in chart.yaml, it also updates related
# image tags in values.yaml.
on:
schedule:
# Run every Monday at noon.
- cron: "0 12 * * 1"
workflow_dispatch:
inputs:
DEBUG_MODE:
description: 'Enable debug mode'
required: false
default: 'false'
jobs:
check_and_update:
runs-on: ubuntu-latest
strategy:
fail-fast: false # Continue all jobs even if one fails
matrix:
# Chart dependencies to check for version updates
include:
- name: 'certmanager'
component: 'operator'
yaml_file_path: 'helm-charts/splunk-otel-collector/Chart.yaml'
dependency_name: 'cert-manager'
- name: 'operator'
component: 'operator'
yaml_file_path: 'helm-charts/splunk-otel-collector/Chart.yaml'
dependency_name: 'opentelemetry-operator'
env:
DEBUG_MODE: ${{ github.event.inputs.DEBUG_MODE }}
steps:
- uses: actions/checkout@v4
- name: Check for Version Updates
id: check_for_update
run: |
echo "Checking chart dependency version for ${{ matrix.name }}"
make update-chart-dep CHART_PATH=${{ matrix.yaml_file_path }} SUBCHART_NAME='${{ matrix.dependency_name }}' DEBUG_MODE=$DEBUG_MODE
- name: Install Skopeo
run: |
sudo apt-get update
sudo apt-get install -y skopeo
- name: Open PR for Version Update
id: open_pr
if: ${{ steps.check_for_update.outputs.NEED_UPDATE == 1 }}
uses: peter-evans/create-pull-request@v7
with:
commit-message: Update ${{ matrix.name }} chart dependency version
title: Bump ${{ matrix.name }} from ${{ steps.check_for_update.outputs.CURRENT_VER }} to ${{ steps.check_for_update.outputs.LATEST_VER }} in ${{ matrix.yaml_file_path }}
body: Use the latest version of ${{ matrix.name }}
branch: "update-${{ matrix.name }}" # Same branch name for all PRs
base: main
delete-branch: true
modify-outputs: false
- name: Apply Version Update and Generate Changelog
if: ${{ steps.check_for_update.outputs.NEED_UPDATE == 1 }}
run: |
# Apply the version update, update the rendered examples with the version update, and create a changelog entry
# We run `make update-chart-dep` again here because the open_pr peter-evans/create-pull-request step before clears out the update changes locally
make update-chart-dep CHART_PATH=${{ matrix.yaml_file_path }} SUBCHART_NAME='${{ matrix.dependency_name }}' DEBUG_MODE=$DEBUG_MODE
make render
make chlog-new FILENAME="update-${{ matrix.name }}" CHANGE_TYPE=enhancement COMPONENT=${{ matrix.component }} NOTE="Bump ${{ matrix.name }} to ${{ steps.check_for_update.outputs.LATEST_VER }} in ${{ matrix.yaml_file_path }}" ISSUES=[${{ steps.open_pr.outputs.pull-request-number }}]
- name: Finalize PR with updates
if: ${{ steps.check_for_update.outputs.NEED_UPDATE == 1 }}
uses: peter-evans/create-pull-request@v7
with:
commit-message: Update ${{ matrix.name }} chart dependency version
title: Bump ${{ matrix.name }} from ${{ steps.check_for_update.outputs.CURRENT_VER }} to ${{ steps.check_for_update.outputs.LATEST_VER }} in ${{ matrix.yaml_file_path }}
body: Use the latest version of ${{ matrix.name }}
branch: "update-${{ matrix.name }}" # Same branch name for all PRs
base: main
delete-branch: true
modify-outputs: false