Skip to content

Commit 13279b4

Browse files
committed
fix(ci): skip deployment pipelines when release tag doesn't match major version
1 parent bef7de4 commit 13279b4

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/v10-deployment-pipeline.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,36 @@ jobs:
3232
# ===================
3333
# Triggered by: prerelease creation
3434
elif ${{ github.event_name == 'release' && github.event.action == 'prereleased' }}; then
35+
TAG="${{ github.event.release.tag_name }}"
36+
37+
# Skip if tag doesn't start with v10 (this pipeline is for v10 only)
38+
if [[ ! "$TAG" =~ ^v10\. ]]; then
39+
echo "⏭️ Skipping: Tag '$TAG' is not a v10 release. This pipeline handles v10 releases only."
40+
exit 0
41+
fi
42+
3543
echo "RC environment"
3644
echo "tag=v10-rc" >> $GITHUB_OUTPUT
3745
echo "environment=rc" >> $GITHUB_OUTPUT
38-
echo "release_tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
46+
echo "release_tag=$TAG" >> $GITHUB_OUTPUT
3947
4048
# ===================
4149
# PROD Environment
4250
# ===================
4351
# Triggered by: prerelease promoted to release
4452
elif ${{ github.event_name == 'release' && github.event.action == 'released' }}; then
53+
TAG="${{ github.event.release.tag_name }}"
54+
55+
# Skip if tag doesn't start with v10 (this pipeline is for v10 only)
56+
if [[ ! "$TAG" =~ ^v10\. ]]; then
57+
echo "⏭️ Skipping: Tag '$TAG' is not a v10 release. This pipeline handles v10 releases only."
58+
exit 0
59+
fi
60+
4561
echo "PROD environment"
4662
echo "tag=v10" >> $GITHUB_OUTPUT
4763
echo "environment=prod" >> $GITHUB_OUTPUT
48-
echo "release_tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
64+
echo "release_tag=$TAG" >> $GITHUB_OUTPUT
4965
fi
5066
5167
validations:

.github/workflows/v11-deployment-pipeline.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ jobs:
7979
TAG="${{ github.event.release.tag_name }}"
8080
echo "Tag from prerelease: $TAG"
8181
82+
# Skip if tag doesn't start with v11 (this pipeline is for v11 only)
83+
if [[ ! "$TAG" =~ ^v11\. ]]; then
84+
echo "⏭️ Skipping: Tag '$TAG' is not a v11 release. This pipeline handles v11 releases only."
85+
exit 0
86+
fi
87+
8288
echo "tag=$TAG" >> $GITHUB_OUTPUT
8389
echo "environment=$ENVIRONMENT" >> $GITHUB_OUTPUT
8490
echo "cm_url=$CM_URL" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)