From 09cce021b1cdb2f3784b4fcec17362079fbb7efe Mon Sep 17 00:00:00 2001 From: Ruoyu Zhong Date: Mon, 15 Jul 2024 13:54:05 -0400 Subject: [PATCH] workflows/sync-shared-config: fix PR creation Hopefully the final fix. `gh pr create` seems to require that the branch exist in remote. --- .github/workflows/sync-shared-config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sync-shared-config.yml b/.github/workflows/sync-shared-config.yml index c0d8b7c9..b87ed756 100644 --- a/.github/workflows/sync-shared-config.yml +++ b/.github/workflows/sync-shared-config.yml @@ -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 \ @@ -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: