Skip to content

Commit 2da05de

Browse files
authored
fix(helm): Fix checker of HELM chart change (#13310)
1 parent 6a826fa commit 2da05de

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/test-helm-chart.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ jobs:
6868
- name: Check update of "artifacthub.io/changes" HELM annotation
6969
if: env.changed == 'true'
7070
run: |
71+
# fast fail if `git show` fails
72+
set -e
73+
set -o pipefail
74+
7175
target_branch=${{ env.ct-branch }}
7276
7377
echo "Checking Chart.yaml annotation changes"
@@ -76,10 +80,10 @@ jobs:
7680
current_annotation=$(yq e '.annotations."artifacthub.io/changes"' "helm/defectdojo/Chart.yaml")
7781
7882
# Get target branch version of Chart.yaml annotation
79-
target_annotation=$(git show "${{ env.ct-branch }}:helm/defectdojo/Chart.yaml" | yq e '.annotations."artifacthub.io/changes"' -)
83+
target_annotation=$(git show "origin/${{ env.ct-branch }}:helm/defectdojo/Chart.yaml" | yq e '.annotations."artifacthub.io/changes"' -)
8084
8185
if [[ "$current_annotation" == "$target_annotation" ]]; then
82-
echo "::error file=helm/defectdojo/Chart.yaml::The 'artifacthub.io/changes' annotation has not been updated compared to ${{ env.ct-branch }}"
86+
echo "::error::The HELM chart has been updated but the 'artifacthub.io/changes' annotation in 'Chart.yaml' has not been changed (compared to '${{ env.ct-branch }}' branch)"
8387
exit 1
8488
fi
8589

0 commit comments

Comments
 (0)