Skip to content

Commit b5296f3

Browse files
committed
add support for old master branches for badges
1 parent ce1860f commit b5296f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

misc/datahub-hooks.bash

+3-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ if [ "$event_type" = "pipeline" ]; then
138138
exit 1
139139
fi
140140

141-
if [ "$event_ref" = "main" ] || [ "$event_ref" = "master" ]; then
141+
if [ "$event_ref" = "$arc_badges_branch_name" ] || [ "$event_ref" = "master" ]; then
142142
echo "Pushing event to the ARC registry...."
143143
arc_registry_push
144144
fi
@@ -170,6 +170,7 @@ if [ "$event_type" = "pipeline" ]; then
170170
## END BLOCK CHECK CQC
171171

172172
[ "$event_ref" = "$arc_badges_branch_name" ] && purge_badges
173+
[ "$event_ref" = "master" ] && purge_badges
173174

174175
## BLOCK COMMIT ARTIFACTS TO $arc_quality_control_branch_name
175176
commit_id="$(jq -r '.commit.id // empty' <<< "$json")"
@@ -238,7 +239,7 @@ if [ "$event_type" = "pipeline" ]; then
238239
## BLOCK BADGES ONLY
239240
# check for svg suffix and only for the configured branch for badges
240241
[ "$file" = "${file%.svg}" ] && continue
241-
[ "$event_ref" != "$arc_badges_branch_name" ] && continue
242+
! ( [ "$event_ref" != "$arc_badges_branch_name" ] || [ "$event_ref" != "master" ] ) && continue
242243

243244
badge_name="validation-$(echo -n ${file%%@*} | tr '/' '-')"
244245
echo "badge name: $badge_name"

0 commit comments

Comments
 (0)