Skip to content

Commit 967d4c0

Browse files
committed
fix: use gh cli to checkout to pr
1 parent 74311db commit 967d4c0

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/preview.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@ concurrency: preview-${{ github.ref }}
1515
jobs:
1616
deploy-preview:
1717
runs-on: ubuntu-latest
18-
if: github.event.action != 'closed' && (github.event.issue.pull_request && contains(github.event.comment.body, '@preview deploy'))
18+
if: github.event.action != 'closed' || (github.event.issue.pull_request && contains(github.event.comment.body, '/preview'))
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0
24-
ref: ${{ github.head_ref}}
24+
25+
- name: Checkout Pull Request
26+
if: github.event.issue.pull_request && contains(github.event.comment.body, '/preview')
27+
run: hub pr checkout ${{ github.event.issue.number }}
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2530

2631
- name: Setup bun
2732
uses: oven-sh/setup-bun@v2

0 commit comments

Comments
 (0)