mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-04-10 19:15:12 +00:00
refactor: simplify tag determination logic in build workflow
This commit is contained in:
parent
1cdf81aab0
commit
654b717d1e
10
.github/workflows/build_retrodeck.yml
vendored
10
.github/workflows/build_retrodeck.yml
vendored
|
@ -117,18 +117,14 @@ jobs:
|
|||
fi
|
||||
|
||||
# Determine the tag based on the GitHub event context
|
||||
if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
|
||||
# Main branch tag
|
||||
TAG="$VERSION"
|
||||
MAKE_LATEST=true
|
||||
elif [[ "$GITHUB_EVENT_NAME" == "pull_request" || "$GITHUB_EVENT_NAME" == "pull_request_target" ]]; then
|
||||
if [[ "$GITHUB_EVENT_NAME" == "pull_request" || "$GITHUB_EVENT_NAME" == "pull_request_target" ]]; then
|
||||
# Pull request tag, sanitize the source branch
|
||||
source_branch="${GITHUB_HEAD_REF//\//-}"
|
||||
TAG="PR-$source_branch-${{ github.run_id }}"
|
||||
MAKE_LATEST=false
|
||||
else
|
||||
# Other branches (cooker branches)
|
||||
TAG="$VERSION-${{ env.BUILD_ID }}"
|
||||
# Other branches (cooker, main branches)
|
||||
TAG="$VERSION"
|
||||
MAKE_LATEST=true
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue