From 08f7106b7081aa40055f06a00cb3d5d230af159b Mon Sep 17 00:00:00 2001 From: Jonathan Kingston Date: Thu, 17 Oct 2024 09:55:42 +0100 Subject: [PATCH 1/2] Remove checking out main --- .github/scripts/diff-directories.js | 3 ++- .github/workflows/build.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/scripts/diff-directories.js b/.github/scripts/diff-directories.js index d184d228a..fd1650f3e 100644 --- a/.github/scripts/diff-directories.js +++ b/.github/scripts/diff-directories.js @@ -69,7 +69,8 @@ function displayDiffs (dir1Files, dir2Files, isOpen) { } const outString = Object.keys(rollupGrouping).map(key => { const rollup = rollupGrouping[key] - let outString = '' + let outString = ` + ` let title = key if (rollup.files.length) { for (const file of rollup.files) { diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d066942ef..65e30f970 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,8 @@ jobs: - name: Fetch files and checkout run: | git fetch origin - git checkout -b main origin/main + git checkout main + git pull origin main git checkout -b releases origin/releases git checkout main -- . From daf2ff43d98e3bdcfdebe4e487c7f170ddc61e8e Mon Sep 17 00:00:00 2001 From: Jonathan Kingston Date: Thu, 17 Oct 2024 10:01:31 +0100 Subject: [PATCH 2/2] Account for both branches existing or not --- .github/workflows/build.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 65e30f970..861059763 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,9 +22,19 @@ jobs: - name: Fetch files and checkout run: | git fetch origin - git checkout main - git pull origin main - git checkout -b releases origin/releases + # Check if the 'main' branch exists, if not, create it + if git rev-parse --verify main >/dev/null 2>&1; then + git checkout main + else + git checkout -b main origin/main + fi + # Check if the 'releases' branch exists, if not, create it + if git rev-parse --verify releases >/dev/null 2>&1; then + git checkout releases + else + git checkout -b releases origin/releases + fi + # Checkout the code of main onto releases git checkout main -- . - name: Build release