Add job to deployment workflow to validate the tag name for a given release

This commit is contained in:
Tyler McGoffin 2024-12-20 14:55:29 -08:00
parent 5402e207ee
commit 1386e3671f

View file

@ -28,7 +28,17 @@ on:
default: true
jobs:
validate-tag-name:
runs-on: ubuntu-latest
steps:
- name: Validate tag name format
run: |
if [[ ! "${{ inputs.tag_name }}" =~ ^v[0-9]+.[0-9]+.[0-9]+$]]; then
echo "Invalid tag name format. Must be in the form v1.2.3"
exit 1
fi
linux:
needs: validate-tag-name
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
if: contains(inputs.platforms, 'linux')
@ -63,6 +73,7 @@ jobs:
dist/*.deb
macos:
needs: validate-tag-name
runs-on: macos-latest
environment: ${{ inputs.environment }}
if: contains(inputs.platforms, 'macos')
@ -134,6 +145,7 @@ jobs:
dist/*.pkg
windows:
needs: validate-tag-name
runs-on: windows-latest
environment: ${{ inputs.environment }}
if: contains(inputs.platforms, 'windows')