-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (59 loc) · 2.86 KB
/
update-value.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
name: UpdateHelmValue
on:
workflow_dispatch:
inputs:
version:
description: "version of argushack in json"
required: true
type: string
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: installl tools
run: |
sudo apt update
sudo apt install gettext-base
sudo wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver
sudo chmod +x /usr/local/bin/semver
semver --version
- name: Checkout
uses: actions/checkout@v3
- name: generator values.yaml
run: |
export attack="${{ fromJson(github.event.inputs.version).attack }}"
export blender="${{ fromJson(github.event.inputs.version).blender }}"
export captain="${{ fromJson(github.event.inputs.version).captain }}"
export core="${{ fromJson(github.event.inputs.version).core }}"
export exploitmgr="${{ fromJson(github.event.inputs.version).exploitmgr }}"
export frontend="${{ fromJson(github.event.inputs.version).frontend }}"
export attackfrontend="${{ fromJson(github.event.inputs.version).attack-frontend }}"
export matcher="${{ fromJson(github.event.inputs.version).matcher }}"
export template="${{ fromJson(github.event.inputs.version).template }}"
export transformer="${{ fromJson(github.event.inputs.version).transformer }}"
export checkindaemon="${{ fromJson(github.event.inputs.version).checkin-daemon }}"
export group="${{ fromJson(github.event.inputs.version).group }}"
export reporttemplate="${{ fromJson(github.event.inputs.version).report-template }}"
export reportinit="${{ fromJson(github.event.inputs.version).report-init }}"
export reportgenerator="${{ fromJson(github.event.inputs.version).report-generator }}"
export poster="${{ fromJson(github.event.inputs.version).poster }}"
export cronjob="${{ fromJson(github.event.inputs.version).cronjob }}"
export date=$(date +%y%m%d)
envsubst < .github/workflows/values.template > "charts/agh2/values.yaml"
envsubst < .github/workflows/Chart.yaml.template > "charts/agh2/Chart.yaml"
cat charts/agh2/values.yaml
cat charts/agh2/Chart.yaml
- name: update chart version
working-directory: charts/agh2
run: |
version="$(cat Chart.yaml | grep -e '^version:' | awk '{print $2}')"
sed -i "s/$version/$(semver bump patch $version)/g" Chart.yaml
- name: Create PR
uses: peter-evans/create-pull-request@v4
with:
branch: build/auto-update-tags-${{ steps.sha.outputs.sha }}
commit-message: |
auto-build: values.yaml update
title: "auto-build: values.yaml update"
body: |
[AUTOMATED UPDATE]