Skip to content

Commit d359601

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

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
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: 11 additions & 5 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,26 @@ jobs:
5353
lint:
5454
name: Lint
5555
runs-on: ubuntu-latest
56+
environment: Package Check
5657
steps:
58+
- name: Debug
59+
run: echo ${{ vars.TEST_VARIABLE }}
5760
- name: Count how many commits need to be fetched
5861
id: base-depth
5962
run: echo "base-depth=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_OUTPUT
6063
- uses: actions/checkout@v4
6164
with:
65+
ref: ${{ github.event.pull_request.head.sha }}
6266
fetch-depth: ${{ steps.base-depth.outputs.base-depth }}
6367
- name: Fetch necessary Git objects
6468
run: |
65-
merge_sha=$(/usr/bin/git log -1 --format=%H)
69+
pr_head=$(/usr/bin/git log -1 --format=%H)
6670
git fetch origin ${{ github.base_ref }}
6771
git checkout ${{ github.base_ref }}
68-
git checkout $merge_sha
69-
- uses: typst/[email protected]
72+
git merge $pr_head --ff
73+
- name: Debug
74+
run: echo $GITHUB_REF_NAME $GITHUB_REF
75+
- uses: typst/package-check@main
7076
with:
7177
installation-id: ${{ secrets.GH_INSTALLATION_ID }}
7278
app-id: ${{ secrets.GH_APP_ID }}

0 commit comments

Comments
 (0)