Skip to content

Commit df5bad0

Browse files
committed
Workaround for gh repo fork
1 parent 8637354 commit df5bad0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

prepare-release/action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,15 @@ runs:
6868
- name: Create Fork
6969
# no-op if the repository is already forked
7070
shell: bash
71-
run: echo FORK=$(gh repo fork --clone=false --remote=false --default-branch-only 2>&1 | awk '{print $1}') >> $GITHUB_ENV
71+
# don't use `gh repo fork` since it doesn't provide consistent output
72+
# see: https://github.com/cli/cli/issues/10079
73+
run: |
74+
echo FORK=$(gh api \
75+
-X POST \
76+
-H "Accept: application/vnd.github+json" \
77+
"/repos/${{ github.repository }}/forks" \
78+
-f default_branch_only=true \
79+
--jq ".full_name") >> $GITHUB_ENV
7280
env:
7381
GH_TOKEN: ${{ inputs.fork-token }}
7482

0 commit comments

Comments
 (0)