From 1b74abfb7090436e2fe97d4dd3554eaf282de2aa Mon Sep 17 00:00:00 2001 From: Peter Pathirana Date: Sat, 15 Jun 2024 20:22:43 +0000 Subject: [PATCH 1/4] fix: only release workflow testing runs should publish w/ suffix '-test' --- .github/workflows/release.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 606b3574..e8522c27 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -229,13 +229,16 @@ jobs: id: publish-template env: TEMPLATE_DIR: ${{ env.template_path }} - TEMPLATE_SUFFIX: "${{ needs.create-release.outputs.released_version != '0.0.0' && '' || '-test' }}" TEMPLATE_VERSION: "${{ needs.create-release.outputs.released_version != '0.0.0' && needs.create-release.outputs.released_version || needs.create-release.outputs.released_sha }}" WORKSPACE_IMAGE: "${{ env.image_name }}:${{ needs.create-release.outputs.released_version != '0.0.0' && needs.create-release.outputs.released_version || needs.create-release.outputs.released_sha }}" shell: bash # yamllint disable-line rule:indentation run: | - export TEMPLATE_NAME="$(echo ${TEMPLATE_DIR} | cut -d/ -f3)${TEMPLATE_SUFFIX}" + if echo $TEMPLATE_VERSION | grep -E '[0-9]+\.[0-9]+\.[0-9]+'; then + export TEMPLATE_NAME="$(echo ${TEMPLATE_DIR} | cut -d/ -f3)-test" + else + export TEMPLATE_NAME="$(echo ${TEMPLATE_DIR} | cut -d/ -f3)-test" + fi echo "TEMPLATE_NAME=${TEMPLATE_NAME}" >> $GITHUB_ENV echo "Publishing template ${TEMPLATE_DIR} as ${TEMPLATE_NAME}..." set -x From 70e52324441e33413b1975263bf2a243f26897da Mon Sep 17 00:00:00 2001 From: Peter Pathirana Date: Sat, 15 Jun 2024 20:32:28 +0000 Subject: [PATCH 2/4] fix: only release workflow testing runs should publish w/ suffix '-test' --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e8522c27..02ec004b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -148,7 +148,7 @@ jobs: with: context: ./${{ env.image_path }} pull: true - push: true + push: ${{ github.event_name == 'workflow_dispatch' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} annotations: ${{ steps.meta.outputs.annotations }} @@ -237,7 +237,7 @@ jobs: if echo $TEMPLATE_VERSION | grep -E '[0-9]+\.[0-9]+\.[0-9]+'; then export TEMPLATE_NAME="$(echo ${TEMPLATE_DIR} | cut -d/ -f3)-test" else - export TEMPLATE_NAME="$(echo ${TEMPLATE_DIR} | cut -d/ -f3)-test" + export TEMPLATE_NAME="$(echo ${TEMPLATE_DIR} | cut -d/ -f3)" fi echo "TEMPLATE_NAME=${TEMPLATE_NAME}" >> $GITHUB_ENV echo "Publishing template ${TEMPLATE_DIR} as ${TEMPLATE_NAME}..." From 67b57c88c4678a761199b426c943ee964e7af300 Mon Sep 17 00:00:00 2001 From: Peter Pathirana Date: Sat, 15 Jun 2024 21:02:38 +0000 Subject: [PATCH 3/4] fix: only release workflow testing runs should publish w/ suffix '-test' --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 02ec004b..d2949612 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -235,9 +235,9 @@ jobs: # yamllint disable-line rule:indentation run: | if echo $TEMPLATE_VERSION | grep -E '[0-9]+\.[0-9]+\.[0-9]+'; then - export TEMPLATE_NAME="$(echo ${TEMPLATE_DIR} | cut -d/ -f3)-test" - else export TEMPLATE_NAME="$(echo ${TEMPLATE_DIR} | cut -d/ -f3)" + else + export TEMPLATE_NAME="$(echo ${TEMPLATE_DIR} | cut -d/ -f3)-test" fi echo "TEMPLATE_NAME=${TEMPLATE_NAME}" >> $GITHUB_ENV echo "Publishing template ${TEMPLATE_DIR} as ${TEMPLATE_NAME}..." From 7a7ecf562086e0fb5348e0900f692cf86bbcc2db Mon Sep 17 00:00:00 2001 From: Peter Pathirana Date: Sat, 15 Jun 2024 21:07:47 +0000 Subject: [PATCH 4/4] fix: only release workflow testing runs should publish w/ suffix '-test' --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d2949612..e977ef43 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -148,7 +148,7 @@ jobs: with: context: ./${{ env.image_path }} pull: true - push: ${{ github.event_name == 'workflow_dispatch' }} + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} annotations: ${{ steps.meta.outputs.annotations }}