-
Notifications
You must be signed in to change notification settings - Fork 15
63 lines (59 loc) · 2.09 KB
/
versions.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
---
name: Image Versions
on:
schedule:
- cron: "37 9 * * 2"
workflow_dispatch:
jobs:
versions:
strategy:
matrix:
include:
- name: Checkov
repository: bridgecrewio/checkov
image: bridgecrew/checkov
value: controller.images.policy
- name: Infracost
repository: infracost/infracost
image: infracost/infracost
value: controller.images.infracost
- name: Terraform
repository: hashicorp/terraform
image: hashicorp/terraform
value: controller.images.terraform
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: develop
- name: Retrieving ${{ matrix.name }} Latest Version
run: |
curl -s https://api.github.com/repos/${{ matrix.repository }}/releases/latest | jq -r '.name' > /tmp/release.latest
- name: Install YQ
env:
BINARY: yq_linux_amd64
VERSION: v4.27.2
run: |
sudo wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
- name: Patch Helm Chart
run: |
export VERSION=$(cat /tmp/release.latest)
export IMAGE="${{ matrix.image }}:${VERSION##v}"
# We should use the CI image for infracost
if [[ "${{ matrix.image }}" == "infracost/infracost" ]]; then
export IMAGE="${{ matrix.image }}:ci-${VERSION##v}"
fi
if [[ "${{ matrix.image }}" == "bridgecrew/checkov" ]]; then
export IMAGE="${{ matrix.image }}:${VERSION}"
fi
yq e '.${{ matrix.value }} = strenv(IMAGE)' -i charts/terranetes-controller/values.yaml
- name: Raise Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch-suffix: timestamp
delete-branch: true
title: "[IMAGES] - ${{ matrix.name }} Image Update"
body: |
Updating the ${{ matrix.name }} image in the helm values to the latest