11name : Test PR
22on :
3- pull_request : {}
3+ pull_request_target : {}
44
55jobs :
66 test :
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- 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