Skip to content

Commit c74c219

Browse files
Remove checking out main (#1117)
* Remove checking out main * Account for both branches existing or not
1 parent 205d2de commit c74c219

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.github/scripts/diff-directories.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ function displayDiffs (dir1Files, dir2Files, isOpen) {
6969
}
7070
const outString = Object.keys(rollupGrouping).map(key => {
7171
const rollup = rollupGrouping[key]
72-
let outString = ''
72+
let outString = `
73+
`
7374
let title = key
7475
if (rollup.files.length) {
7576
for (const file of rollup.files) {

.github/workflows/build.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,19 @@ jobs:
2222
- name: Fetch files and checkout
2323
run: |
2424
git fetch origin
25-
git checkout -b main origin/main
26-
git checkout -b releases origin/releases
25+
# Check if the 'main' branch exists, if not, create it
26+
if git rev-parse --verify main >/dev/null 2>&1; then
27+
git checkout main
28+
else
29+
git checkout -b main origin/main
30+
fi
31+
# Check if the 'releases' branch exists, if not, create it
32+
if git rev-parse --verify releases >/dev/null 2>&1; then
33+
git checkout releases
34+
else
35+
git checkout -b releases origin/releases
36+
fi
37+
# Checkout the code of main onto releases
2738
git checkout main -- .
2839
2940
- name: Build release

0 commit comments

Comments
 (0)