You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/test-helm-chart.yml
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,10 @@ jobs:
68
68
- name: Check update of "artifacthub.io/changes" HELM annotation
69
69
if: env.changed == 'true'
70
70
run: |
71
+
# fast fail if `git show` fails
72
+
set -e
73
+
set -o pipefail
74
+
71
75
target_branch=${{ env.ct-branch }}
72
76
73
77
echo "Checking Chart.yaml annotation changes"
@@ -76,10 +80,10 @@ jobs:
76
80
current_annotation=$(yq e '.annotations."artifacthub.io/changes"' "helm/defectdojo/Chart.yaml")
77
81
78
82
# 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"' -)
80
84
81
85
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)"
0 commit comments