Skip to content

Commit 30159e5

Browse files
committed
fix: create publish branch if not exist
1 parent 37a85f1 commit 30159e5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,15 @@ jobs:
3737
TARGET_DIR="${VERSION}"
3838
fi
3939
40-
git fetch origin publish
41-
git checkout -b publish origin/publish
40+
git fetch origin
41+
if ! git show-ref --quiet refs/heads/publish; then
42+
git checkout --orphan publish
43+
git rm -rf .
44+
git commit --allow-empty -m "Initial"
45+
git push origin publish
46+
else
47+
git checkout -b publish origin/publish
48+
fi
4249
4350
mkdir -p ${TARGET_DIR}
4451
find "$TARGET_DIR" -mindepth 1 -not -regex '.*/[0-9]+\.[0-9]+\.[0-9]+$' -exec rm -rf {} +

0 commit comments

Comments
 (0)