From c76dea468e01c50a7f7f342fda1e4186f019a94b Mon Sep 17 00:00:00 2001 From: Aaron <29749331+aarnphm@users.noreply.github.com> Date: Thu, 29 Jun 2023 02:38:44 -0400 Subject: [PATCH] chore(ci): fixes release script to correct version Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- .github/actions/create_release_and_archive.sh | 19 ++++++++++++++++--- .github/workflows/release-notes.yml | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/actions/create_release_and_archive.sh b/.github/actions/create_release_and_archive.sh index 13e9ae83..3d9dd852 100755 --- a/.github/actions/create_release_and_archive.sh +++ b/.github/actions/create_release_and_archive.sh @@ -15,9 +15,22 @@ set -o errexit -o nounset -o pipefail -# Set by GH actions, see -# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables -TAG=${GITHUB_REF_NAME#v} +TAG="$1" + +semver_regex='^[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*$' + +# Check if an argument is provided +if [ $# -eq 0 ]; then + echo "No argument provided." + exit 1 +fi + +if [[ $TAG =~ $semver_regex ]]; then + echo "Valid semver: $TAG" +else + echo "Invalid semver: $TAG" + exit 1 +fi cat > release_notes.txt << EOF ## Installation diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index 6116e93d..9d302195 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -50,7 +50,7 @@ jobs: - name: Setup CI uses: ./.github/actions/setup-repo - name: Create release notes - run: ./.github/actions/create_release_and_archive.sh + run: ./.github/actions/create_release_and_archive.sh ${{ inputs.tags }} - name: Download Python artifacts uses: actions/download-artifact@v3 with: