mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-04-10 19:15:12 +00:00
WORKFLOW: tentative PR branch name fixes -fix2 [skip ci]
This commit is contained in:
parent
f9135435c7
commit
40ed129132
17
.github/workflows/cooker-selfhosted.yml
vendored
17
.github/workflows/cooker-selfhosted.yml
vendored
|
|
@ -81,14 +81,19 @@ jobs:
|
||||||
|
|
||||||
# Check if the event is related to a pull request
|
# Check if the event is related to a pull request
|
||||||
if [[ "$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
|
||||||
pr_number=$(echo "$GITHUB_REF" | awk -F'/' '{print $3}')
|
# Use GITHUB_HEAD_REF to get the source branch
|
||||||
source_branch=$(curl -s "https://api.github.com/repos/RetroDECK/RetroDECK/pulls/$pr_number" | jq -r '.head.ref')
|
source_branch="${GITHUB_HEAD_REF}"
|
||||||
source_branch=${source_branch//\//-} # Replace '/' with '-' in the branch name
|
|
||||||
|
# Replace '/' with '-' in the branch name
|
||||||
|
source_branch=${source_branch//\//-}
|
||||||
echo "[DEBUG] source branch is: $source_branch"
|
echo "[DEBUG] source branch is: $source_branch"
|
||||||
echo "TAG=PR-$pr_number-$(echo $source_branch-${{ env.buildid }} | sed 's/\//-/g')" >> $GITHUB_ENV
|
|
||||||
echo "MAKE_LATEST=false" >> $GITHUB_ENV # if it's a feature branch it will not marked as "latest" cooker version
|
# Generate the tag for a pull request
|
||||||
|
echo "TAG=PR-$GITHUB_RUN_ID-$source_branch-${{ env.buildid }}" >> $GITHUB_ENV
|
||||||
|
echo "MAKE_LATEST=false" >> $GITHUB_ENV # Not marked as the latest cooker version if it's a feature branch
|
||||||
else
|
else
|
||||||
TAG="$MANIFEST_VERSION-${{ env.buildid }} | sed 's/\//-/g'"
|
# Generate the tag for non-pull request branches
|
||||||
|
TAG="$MANIFEST_VERSION-${{ env.buildid }}"
|
||||||
echo "TAG=$TAG" >> $GITHUB_ENV
|
echo "TAG=$TAG" >> $GITHUB_ENV
|
||||||
echo "MAKE_LATEST=true" >> $GITHUB_ENV
|
echo "MAKE_LATEST=true" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue