Skip to content

Commit a75ce35

Browse files
author
David Grisham
committed
ci: validate release tag in production deploy
1 parent 4a20668 commit a75ce35

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/ci-release-production.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ jobs:
7474
- name: Copy production.env
7575
run: cp ./.github/configs/production.env .env
7676

77+
- name: Validate tag
78+
run: |
79+
tag="${GITHUB_REF#refs/tags/}"
80+
if [[ ! "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-beta$ ]]; then
81+
echo "Unsupported tag '$tag', skipping release and deploy jobs" >&2
82+
exit 1
83+
fi
84+
7785
- name: Set deploy environment vars
7886
run: echo "RELEASE_ID=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
7987

@@ -122,6 +130,14 @@ jobs:
122130
- name: install bash
123131
run: apk add --no-cache bash
124132

133+
- name: Validate tag
134+
run: |
135+
tag="${GITHUB_REF#refs/tags/}"
136+
if [[ ! "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-beta$ ]]; then
137+
echo "Unsupported tag '$tag', skipping release and deploy jobs" >&2
138+
exit 1
139+
fi
140+
125141
- name: Set deploy environment vars
126142
run: |
127143
echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

0 commit comments

Comments
 (0)