Skip to content

Commit 14f94f0

Browse files
committed
Run the CI in the correct context
1 parent 8ebcf31 commit 14f94f0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
deploy:
1313
name: Deploy
1414
runs-on: ubuntu-latest
15+
environment: Deploy
1516
steps:
1617
- uses: actions/checkout@v4
1718
with:

.github/workflows/test_pr.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Test PR
22
on:
3-
pull_request: {}
3+
pull_request_target: {}
44

55
jobs:
66
test:
@@ -33,9 +33,9 @@ jobs:
3333
sparseCheckoutPaths = Array.from(packages).map((pkg) => `packages/preview/${pkg.name}/${pkg.version}/`).join('\n');
3434
}
3535
core.setOutput('sparse-checkout-paths', sparseCheckoutPaths);
36-
3736
- uses: actions/checkout@v4
3837
with:
38+
ref: ${{ github.event.pull_request.head.sha }}
3939
sparse-checkout: |
4040
${{ steps.extract-package.outputs.sparse-checkout-paths }}
4141
bundler/
@@ -53,20 +53,20 @@ jobs:
5353
lint:
5454
name: Lint
5555
runs-on: ubuntu-latest
56+
environment: Package Check
5657
steps:
5758
- name: Count how many commits need to be fetched
5859
id: base-depth
5960
run: echo "base-depth=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_OUTPUT
6061
- uses: actions/checkout@v4
6162
with:
63+
ref: ${{ github.event.pull_request.head.sha }}
6264
fetch-depth: ${{ steps.base-depth.outputs.base-depth }}
6365
- name: Fetch necessary Git objects
6466
run: |
65-
merge_sha=$(/usr/bin/git log -1 --format=%H)
6667
git fetch origin ${{ github.base_ref }}
67-
git checkout ${{ github.base_ref }}
68-
git checkout $merge_sha
69-
- uses: typst/[email protected]
68+
git rebase ${{ github.base_ref }}
69+
- uses: typst/package-check@main
7070
with:
7171
installation-id: ${{ secrets.GH_INSTALLATION_ID }}
7272
app-id: ${{ secrets.GH_APP_ID }}

0 commit comments

Comments
 (0)