From 05b82e9b22eee2e61af2aacf092d48d6ff59bf34 Mon Sep 17 00:00:00 2001 From: Romain Floreani Date: Mon, 31 Aug 2026 09:35:45 -0400 Subject: [PATCH 1/3] check will run everytime + Adding a check that it starts with v* --- .github/workflows/python_deploy_prod.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python_deploy_prod.yml b/.github/workflows/python_deploy_prod.yml index 1dd99e1d..42a60ec0 100644 --- a/.github/workflows/python_deploy_prod.yml +++ b/.github/workflows/python_deploy_prod.yml @@ -29,14 +29,20 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - name: Ensure this run was triggered from a tag - if: ${{ github.event_name == 'workflow_dispatch' && github.ref_type != 'tag' }} + - name: Ensure this run was triggered from a valid release tag env: REF_TYPE: ${{ github.ref_type }} REF_NAME: ${{ github.ref_name }} run: | - echo "::error::This run was not triggered from a tag (ref_type=$REF_TYPE, ref_name=$REF_NAME). Re-run this workflow selecting the release tag under 'Use workflow from'." - exit 1 + if [ "$REF_TYPE" != "tag" ]; then + echo "::error::This run was not triggered from a tag (ref_type=$REF_TYPE, ref_name=$REF_NAME). Re-run this workflow selecting the release tag under 'Use workflow from'." + exit 1 + fi + if [[ "$REF_NAME" != v* ]]; then + echo "::error::Tag '$REF_NAME' does not look like a release tag (release tags must start with 'v'). Re-run this workflow selecting a valid release tag." + exit 1 + fi + echo "::notice::Release tag '$REF_NAME' validated successfully." call-workflow-conda-release: name: Publish production Conda package on JFrog Artifactory needs: validate-release-tag From 09aa3e16fb948b7f33870ec777fdabb3bb324e64 Mon Sep 17 00:00:00 2001 From: Romain Floreani Date: Mon, 31 Aug 2026 11:59:23 -0400 Subject: [PATCH 2/3] Fixing the Github copilot error message --- .github/workflows/python_deploy_prod.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python_deploy_prod.yml b/.github/workflows/python_deploy_prod.yml index 42a60ec0..807d857c 100644 --- a/.github/workflows/python_deploy_prod.yml +++ b/.github/workflows/python_deploy_prod.yml @@ -31,18 +31,30 @@ jobs: steps: - name: Ensure this run was triggered from a valid release tag env: + EVENT_NAME: ${{ github.event_name }} + RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} REF_TYPE: ${{ github.ref_type }} REF_NAME: ${{ github.ref_name }} run: | - if [ "$REF_TYPE" != "tag" ]; then - echo "::error::This run was not triggered from a tag (ref_type=$REF_TYPE, ref_name=$REF_NAME). Re-run this workflow selecting the release tag under 'Use workflow from'." + if [ "$EVENT_NAME" = "release" ]; then + TAG="$RELEASE_TAG_NAME" + elif [ "$EVENT_NAME" = "workflow_dispatch" ]; then + if [ "$REF_TYPE" != "tag" ]; then + echo "::error::This run was not triggered from a tag (ref_type=$REF_TYPE, ref_name=$REF_NAME). Re-run this workflow selecting the release tag under 'Use workflow from'." + exit 1 + fi + TAG="$REF_NAME" + else + echo "::error::Unsupported trigger event '$EVENT_NAME'." exit 1 fi - if [[ "$REF_NAME" != v* ]]; then - echo "::error::Tag '$REF_NAME' does not look like a release tag (release tags must start with 'v'). Re-run this workflow selecting a valid release tag." + + if [[ "$TAG" != v* ]]; then + echo "::error::Tag '$TAG' does not look like a release tag (release tags must start with 'v'). Re-run this workflow selecting a valid release tag." exit 1 fi - echo "::notice::Release tag '$REF_NAME' validated successfully." + + echo "::notice::Release tag '$TAG' validated successfully." call-workflow-conda-release: name: Publish production Conda package on JFrog Artifactory needs: validate-release-tag From df0939cb8abb4dbb9579a3382831e2cf5008e625 Mon Sep 17 00:00:00 2001 From: Romain Floreani Date: Tue, 1 Sep 2026 08:52:12 -0400 Subject: [PATCH 3/3] Updating PR feedback --- .github/workflows/python_deploy_prod.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/python_deploy_prod.yml b/.github/workflows/python_deploy_prod.yml index 807d857c..0a320e22 100644 --- a/.github/workflows/python_deploy_prod.yml +++ b/.github/workflows/python_deploy_prod.yml @@ -37,24 +37,18 @@ jobs: REF_NAME: ${{ github.ref_name }} run: | if [ "$EVENT_NAME" = "release" ]; then - TAG="$RELEASE_TAG_NAME" + echo "::notice::Triggered by published release '$RELEASE_TAG_NAME'." elif [ "$EVENT_NAME" = "workflow_dispatch" ]; then if [ "$REF_TYPE" != "tag" ]; then echo "::error::This run was not triggered from a tag (ref_type=$REF_TYPE, ref_name=$REF_NAME). Re-run this workflow selecting the release tag under 'Use workflow from'." exit 1 fi - TAG="$REF_NAME" - else - echo "::error::Unsupported trigger event '$EVENT_NAME'." - exit 1 - fi - - if [[ "$TAG" != v* ]]; then - echo "::error::Tag '$TAG' does not look like a release tag (release tags must start with 'v'). Re-run this workflow selecting a valid release tag." - exit 1 + if [[ "$REF_NAME" != v* ]]; then + echo "::error::Tag '$REF_NAME' does not look like a release tag (release tags must start with 'v'). Re-run this workflow selecting a valid release tag." + exit 1 + fi + echo "::notice::Release tag '$REF_NAME' validated successfully." fi - - echo "::notice::Release tag '$TAG' validated successfully." call-workflow-conda-release: name: Publish production Conda package on JFrog Artifactory needs: validate-release-tag