88 runs-on : ubuntu-latest
99 steps :
1010 - name : Extract package names and versions from changed files
11- id : extract_package
11+ id : extract-package
1212 uses : actions/github-script@v7
1313 with :
1414 script : |
@@ -22,22 +22,22 @@ jobs:
2222 files.forEach(file => {
2323 const match = file.filename.match(/^packages\/preview\/([^\/]+)\/([^\/]+)\//);
2424 if (match) {
25- packages.add(`${ match[1]}/${ match[2]}` );
25+ packages.add({ namespace: "preview", name: match[1], version: match[2] } );
2626 }
2727 });
2828
2929 let sparseCheckoutPaths;
3030 if (packages.size === 0) {
3131 sparseCheckoutPaths = "packages/";
3232 } else {
33- sparseCheckoutPaths = Array.from(packages).map(pkg => `packages/preview/${pkg}/`).join('\n');
33+ sparseCheckoutPaths = Array.from(packages).map(( pkg) => `packages/preview/${pkg.name}/${pkg.version }/`).join('\n');
3434 }
35- core.setOutput('sparse_checkout_paths ', sparseCheckoutPaths);
35+ core.setOutput('sparse-checkout-paths ', sparseCheckoutPaths);
3636
3737 - uses : actions/checkout@v4
3838 with :
3939 sparse-checkout : |
40- ${{ steps.extract_package .outputs.sparse_checkout_paths }}
40+ ${{ steps.extract-package .outputs.sparse-checkout-paths }}
4141 bundler/
4242 - uses : dtolnay/rust-toolchain@stable
4343 - uses : Swatinem/rust-cache@v2
4949
5050 - name : Test packaging
5151 run : bundler/target/release/bundler
52+
53+ lint :
54+ name : Lint
55+ runs-on : ubuntu-latest
56+ steps :
57+ - name : Count how many commits need to be fetched
58+ id : base-depth
59+ run : echo "base-depth=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_OUTPUT
60+ - uses : actions/checkout@v4
61+ with :
62+ fetch-depth : ${{ steps.base-depth.outputs.base-depth }}
63+ - name : Fetch necessary Git objects
64+ run : |
65+ merge_sha=$(/usr/bin/git log -1 --format=%H)
66+ git fetch origin ${{ github.base_ref }}
67+ git checkout ${{ github.base_ref }}
68+ git checkout $merge_sha
69+ 70+ with :
71+ installation-id : ${{ secrets.GH_INSTALLATION_ID }}
72+ app-id : ${{ secrets.GH_APP_ID }}
73+ private-key : ${{ secrets.GH_PRIVATE_KEY }}
0 commit comments