From cbcdb6641747d321af03ae982a16cacaa21c88f1 Mon Sep 17 00:00:00 2001 From: Cyanoure Date: Sun, 15 Sep 2024 16:25:33 +0200 Subject: [PATCH] Actions: Merge if branch exists --- .github/workflows/Build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index be1e042..2393036 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -24,13 +24,13 @@ jobs: with: node-version: '22' - # Delete existing build branch - - name: Delete existing build branch - run: git branch -d ${GITHUB_REF_NAME}-build || echo "Build branch not found" - - # Create and switch to build branch - - name: Create and switch to build branch - run: git branch ${GITHUB_REF_NAME}-build && git switch ${GITHUB_REF_NAME}-build + # Initialize build branch + - name: Initialize build branch + run: | + git branch ${GITHUB_REF_NAME}-build || echo "Build branch already exists" + git switch ${GITHUB_REF_NAME}-build + git merge ${GITHUB_REF_NAME} + rm -rf dist # Install dependencies - name: Install dependencies