Skip to content

Commit

Permalink
workflows/sync-shared-config: fix PR creation
Browse files Browse the repository at this point in the history
Hopefully the final fix. `gh pr create` seems to require that the branch
exist in remote.
  • Loading branch information
ZhongRuoyu committed Jul 15, 2024
1 parent 77b17ac commit 09cce02
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/sync-shared-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ jobs:
cd target/${{ matrix.repo }}
git checkout -b sync-shared-config
git push --set-upstream --force-with-lease origin sync-shared-config
if gh api \
-X GET \
Expand All @@ -118,10 +119,8 @@ jobs:
/repos/{owner}/{repo}/pulls \
-f head=Homebrew:sync-shared-config \
-f state=open |
jq --exit-status any
jq --exit-status 'length == 0'
then
git push --force-with-lease origin sync-shared-config
else
gh pr create --head sync-shared-config --title "Synchronize shared configuration" --body 'This pull request was created automatically by the [`sync-shared-config`](https://github.com/Homebrew/.github/blob/HEAD/.github/actions/sync/shared-config.rb) workflow.'
fi
env:
Expand Down

0 comments on commit 09cce02

Please sign in to comment.