Skip to content

Commit c0025a7

Browse files
author
Leonid Podolinskiy
authored
init containers pipeline trigger add validation (#14)
do not create init containers for special releases
1 parent 8bcdea8 commit c0025a7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/init_container.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
description: 'Image tag'
1111
required: true
1212
default: "0"
13+
force:
14+
description: 'Force build'
15+
required: false
16+
default: "false"
1317

1418

1519

@@ -27,6 +31,15 @@ jobs:
2731
- name: Set release tag
2832
shell: bash
2933
run: |
34+
# check that tag is matching regex x.y.x-release.<commit hash> or force flag is enabled
35+
if [[ ! ${{ inputs.release_tag }} =~ ^[0-9]+\.[0-9]+\.[0-9]+-release\.[0-9a-f]+$ ]] ; then
36+
echo "Tag ${{ inputs.release_tag }} is not matching regex x.y.x-release.<commithash>"
37+
if [[ "${{ inputs.force }}" == "true" ]] ; then
38+
echo "Force flag is enabled. Continue"
39+
else
40+
exit 1
41+
fi
42+
fi
3043
echo "TAG_NAME=$(echo ${{ inputs.release_tag }} | sed -E 's/^([0-9]*\.[0-9]*\.[0-9]*).*/\1/')-init.${{ inputs.init_image_tag }}" >> "$GITHUB_OUTPUT"
3144
id: set_tag
3245

@@ -100,4 +113,4 @@ jobs:
100113
SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
101114
SLACK_MESSAGE: "Tag ${{ inputs.release_tag }} | Platform ${{ matrix.agents.platform }}"
102115
SLACK_TITLE: Init contianer build status - ${{ job.status }}
103-
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
116+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)