From b1c1c7d809a03853c307a00c491dbd9ae5813a6b Mon Sep 17 00:00:00 2001 From: XargonWan Date: Fri, 23 Aug 2024 09:22:52 +0900 Subject: [PATCH] WORKFLOW: tentative PR branch name fixes [skip ci] --- .github/workflows/cooker-selfhosted.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index 292e0df4..445bcae9 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -62,8 +62,14 @@ jobs: - name: Get branch name id: branch_name - run: echo "BRANCH_NAME=$(echo $GITHUB_REF | sed 's|refs/heads/||')" >> $GITHUB_ENV - + run: | + if [[ "$GITHUB_EVENT_NAME" == "pull_request" || "$GITHUB_EVENT_NAME" == "pull_request_target" ]]; then + source_branch="${{ github.head_ref }}" + echo "BRANCH_NAME=$source_branch" >> $GITHUB_ENV + else + branch_name=$(echo $GITHUB_REF | sed 's|refs/heads/||') + echo "BRANCH_NAME=$branch_name" >> $GITHUB_ENV + fi # if the branch is coming from a PR the tag should be manually built - name: "Generate version tag and evaluating latest tag"