From 1386e3671fd630cc72aab49ca5c532d146ed6583 Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Fri, 20 Dec 2024 14:55:29 -0800 Subject: [PATCH 1/2] Add job to deployment workflow to validate the tag name for a given release --- .github/workflows/deployment.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 2dd6af675..6c166580e 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -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') From 5fc56ded50e737950b7032c72e42ed6de5ba2083 Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Thu, 26 Dec 2024 10:50:09 -0800 Subject: [PATCH 2/2] Escape '.' in version validation regex in deployment workflow --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 6c166580e..88492ef2c 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -33,7 +33,7 @@ jobs: steps: - name: Validate tag name format run: | - if [[ ! "${{ inputs.tag_name }}" =~ ^v[0-9]+.[0-9]+.[0-9]+$]]; then + 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