Skip to content

Commit 19f9614

Browse files
committed
Updatecli: Check for dependency updates
Signed-off-by: Weifeng Wang <[email protected]> Auto check for dependency updates Signed-off-by: Weifeng Wang <[email protected]>
1 parent 6410bc0 commit 19f9614

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Bump dependency Helm charts version
2+
sources:
3+
grafana:
4+
name: Get latest "grafana" Helm chart version
5+
kind: helmchart
6+
spec:
7+
name: grafana
8+
url: https://grafana.github.io/helm-charts
9+
versionfilter:
10+
kind: semver
11+
pattern: '*'
12+
alloy:
13+
name: Get latest "alloy" Helm chart version
14+
kind: helmchart
15+
spec:
16+
name: alloy
17+
url: https://grafana.github.io/helm-charts
18+
versionfilter:
19+
kind: semver
20+
pattern: '*'
21+
22+
conditions:
23+
grafana:
24+
name: Ensure Helm chart dependency "grafana" is specified
25+
kind: yaml
26+
spec:
27+
file: kubernetes/common/grafana/kustomization.yaml
28+
key: $.helmCharts[0].name
29+
value: grafana
30+
disablesourceinput: true
31+
alloy:
32+
name: Ensure Helm chart dependency "alloy" is specified
33+
kind: yaml
34+
spec:
35+
file: kubernetes/common/alloy/kustomization.yaml
36+
key: $.helmCharts[0].name
37+
value: alloy
38+
disablesourceinput: true
39+
40+
targets:
41+
grafana:
42+
name: Bump "grafana" Helm chart version
43+
kind: yaml
44+
spec:
45+
file: kubernetes/common/grafana/kustomization.yaml
46+
key: $.helmCharts[0].version
47+
sourceid: grafana
48+
alloy:
49+
name: Bump "alloy" Helm chart version
50+
kind: yaml
51+
spec:
52+
file: kubernetes/common/alloy/kustomization.yaml
53+
key: $.helmCharts[0].version
54+
sourceid: alloy

.github/workflows/updatecli.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: "Updatecli: Check for dependency updates"
3+
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
# * is a special character in YAML so you have to quote this string
8+
# Run once a day
9+
- cron: '0 7 * * *'
10+
11+
env:
12+
UPDATECLI_CONFIG_DIR: "${{ github.workspace }}/.github/updatecli.d"
13+
14+
jobs:
15+
updatecli:
16+
name: Update dependency helm charts
17+
runs-on: "ubuntu-latest"
18+
steps:
19+
-
20+
name: Create Github App[bot] Token
21+
uses: actions/create-github-app-token@v1
22+
id: app-token
23+
with:
24+
app-id: ${{ vars.APP_ID }}
25+
private-key: ${{ secrets.PRIVATE_KEY }}
26+
-
27+
name: Checkout
28+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
29+
-
30+
name: Setup updatecli
31+
uses: updatecli/updatecli-action@v2
32+
-
33+
name: Run Updatecli
34+
id: updatecli-apply
35+
run: |
36+
updatecli apply --config ${UPDATECLI_CONFIG_DIR}/deps-charts.yaml > changelog.out 2>&1
37+
if ! git diff --exit-code > /dev/null; then
38+
echo "changed=true" >> "${GITHUB_OUTPUT}"
39+
echo "body=$(cat changelog.out | awk 'NR >= 22')" >> "${GITHUB_OUTPUT}"
40+
fi
41+
-
42+
name: Create pull request
43+
if: steps.updatecli-apply.outputs.changed == 'true'
44+
uses: peter-evans/create-pull-request@c55203cfde3e5c11a452d352b4393e68b85b4533 #v6.0.3
45+
with:
46+
token: ${{ steps.app-token.outputs.token }}
47+
title: "[updatecli] Bump dependency helm charts version to latest"
48+
commit-message: Updates dependency helm charts
49+
committer: 🤖QC Owl App[bot] <165384878+qc-owl-app[bot]@users.noreply.github.com>
50+
signoff: true
51+
body: |
52+
🤖 Updates Dependency Helm Charts
53+
54+
<details>
55+
<summary> FULL CHANGELOG </summary>
56+
<blockquote>
57+
58+
${{ steps.updatecli-apply.outputs.body }}
59+
60+
</blockquote>
61+
</details>
62+
<br />
63+
64+
> Auto-generated by [.github/workflows/updatecli.yml][0]
65+
66+
[0]: https://github.com/qclaogui/codelab-monitoring/blob/main/.github/workflows/updatecli.yml
67+
labels: dependencies
68+
branch: update-helm-charts
69+
delete-branch: true

0 commit comments

Comments
 (0)