Skip to content

Commit 18593a2

Browse files
committed
ci: checkout PR branch before publishing bottles
1 parent 6ab27f4 commit 18593a2

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ jobs:
4040
with:
4141
username: github-actions[bot]
4242

43+
- name: Checkout PR Branch
44+
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
45+
env:
46+
GH_TOKEN: ${{ github.token }}
47+
run: gh pr checkout ${{ github.event.pull_request.number }}
48+
4349
- name: Pull and Publish Bottles
4450
env:
4551
HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }}
@@ -49,20 +55,19 @@ jobs:
4955
run: |
5056
brew pr-pull \
5157
--debug \
58+
--clean \
59+
--no-cherry-pick \
5260
--artifact-pattern 'bottles_*' \
5361
--tap="$GITHUB_REPOSITORY" \
5462
--workflows ci.yml \
5563
'${{ github.event.pull_request.number }}'
5664
57-
- name: Cherry Pick Bottle Commit and Push to PR Branch
58-
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
59-
env:
60-
Branch: ${{ github.event.pull_request.head.ref }}
61-
run: |
62-
bottle_commit=$(git rev-parse HEAD)
63-
git checkout "$Branch"
64-
git cherry-pick "$bottle_commit"
65-
git push -v origin "$Branch"
65+
- name: Push commits
66+
uses: Homebrew/actions/git-try-push@master
67+
with:
68+
token: ${{ github.token }}
69+
branch: ${{ github.event.pull_request.head.ref }}
70+
directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
6671

6772
- name: Wait for Remote Branch to be Updated
6873
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}

0 commit comments

Comments
 (0)