Skip to content

Commit ff20230

Browse files
authored
fix: resolve 'origin/gh-pages' is not a commit and a branch cannot be created from it error (#1702)
* fix: orphan branch issue * Update worktree.ts * Update worktree.ts * Update worktree.ts * Update worktree.ts * Update build.yml * Update build.yml * Update build.yml * Update build.yml
1 parent b06fcc8 commit ff20230

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ jobs:
6868
lib
6969
node_modules
7070
71-
- name: Cleanup Generated Branches
72-
uses: dawidd6/[email protected]
73-
continue-on-error: true
74-
with:
75-
github_token: ${{ secrets.GITHUB_TOKEN }}
76-
branches: gh-pages
77-
7871
integration:
7972
runs-on: ubuntu-latest
8073
needs: build
@@ -120,7 +113,8 @@ jobs:
120113
- name: Tweak content to publish to existing branch
121114
if: ${{ matrix.branch == 'gh-pages' }}
122115
run: |
123-
echo "<!-- just sayin -->" >> integration/index.html
116+
RANDOM_CHAR=$(echo $RANDOM | tr -dc 'a-zA-Z0-9' | fold -w 1 | head -n 1)
117+
echo "<!-- just sayin $RANDOM_CHAR -->" >> integration/index.html
124118
125119
- name: Deploy with modifications to existing branch
126120
id: modified

src/worktree.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ export async function generateWorktree(
101101
'Error encountered while checking out branch. Attempting to continue with a new branch name.'
102102
)
103103
branchName = `temp-${Date.now()}`
104-
checkout.orphan = true
105-
checkout = new GitCheckout(branchName, `origin/${action.branch}`)
104+
checkout = new GitCheckout(branchName)
106105

107106
await execute(
108107
checkout.toString(),

0 commit comments

Comments
 (0)