fix: only generate date tag for main branch

This commit is contained in:
Marco Ceppi
2022-12-23 20:06:08 -05:00
committed by GitHub
parent b022183862
commit 94aa5bb8df

View File

@@ -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")