fix: only generate date tag for main branch
This commit is contained in:
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@@ -33,13 +33,14 @@ jobs:
|
|||||||
id: generate-tags
|
id: generate-tags
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "date=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
|
|
||||||
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
alias_tags=()
|
alias_tags=()
|
||||||
|
# Only perform the follow code when the action is spawned from a Pull Request
|
||||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
alias_tags+=("pr-${{ github.event.number }}")
|
alias_tags+=("pr-${{ github.event.number }}")
|
||||||
else
|
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 }}")
|
alias_tags+=("${{ matrix.major_version }}")
|
||||||
if [[ "${{ matrix.is_latest }}" == "true" ]]; then
|
if [[ "${{ matrix.is_latest }}" == "true" ]]; then
|
||||||
alias_tags+=("latest")
|
alias_tags+=("latest")
|
||||||
|
|||||||
Reference in New Issue
Block a user