From 94aa5bb8df2aac0985d4c9422b19b0c03a3f25b0 Mon Sep 17 00:00:00 2001 From: Marco Ceppi Date: Fri, 23 Dec 2022 20:06:08 -0500 Subject: [PATCH] fix: only generate date tag for main branch --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92b2a284cd..65c8da637b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,13 +33,14 @@ jobs: id: generate-tags shell: bash run: | - echo "date=$(date +%Y%m%d)" >> $GITHUB_OUTPUT echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - alias_tags=() + # Only perform the follow code when the action is spawned from a Pull Request if [[ "${{ github.event_name }}" == "pull_request" ]]; then alias_tags+=("pr-${{ github.event.number }}") else + # The following is run when the timer is triggered or a merge/push to main + echo "date=$(date +%Y%m%d)" >> $GITHUB_OUTPUT alias_tags+=("${{ matrix.major_version }}") if [[ "${{ matrix.is_latest }}" == "true" ]]; then alias_tags+=("latest")