Create the branch only if needed

This commit is contained in:
Judson Lester 2022-10-19 12:47:05 -07:00
parent 6f9fc6eab1
commit 1ee5a6cee5
No known key found for this signature in database
GPG Key ID: 12E21E4B9A3F82AA
1 changed files with 1 additions and 0 deletions

View File

@ -140,6 +140,7 @@ runs:
git fetch origin $DESTINATION_BRANCH
else
export BASE=$(gh repo view --json defaultBranchRef --template '{{ .defaultBranchRef.name }}' ${{github.repository}})
export BASE_SHA=$( git rev-parse origin/$BASE )
gh api --method POST /repos/:owner/:repo/git/refs \
--field ref=refs/heads/$DESTINATION_BRANCH \
--field sha=$BASE_SHA