-
Notifications
You must be signed in to change notification settings - Fork 217
41 lines (36 loc) · 1.14 KB
/
validate-chart-appVersion.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
name: Chart-Content
on:
pull_request_target:
types:
- closed
paths:
- deploy/helm/Chart.yaml
jobs:
appVersion-validation:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get latest tag
id: latest_tag
run: |
latest_tag=$(git describe --tags --abbrev=0 | sed 's/v//')
echo "::set-output name=tag::$latest_tag"
- name: Read Chart.yaml appVersion
id: chart_version
run: |
app_version=$(grep -E '^appVersion:' deploy/helm/Chart.yaml | awk '{print $2}')
echo "::set-output name=app_version::$app_version"
- name: Repository Dispatch Publish Helm Chart
if: ${{ steps.latest_tag.outputs.tag == steps.chart_version.outputs.app_version }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: publish-chart
client-payload: '{"action": "chart-release"}'