11name : CI
2+
23on :
4+ release :
35 push :
46 branches : [main]
57 pull_request :
68 branches : [main]
9+
10+ permissions :
11+ contents : read
12+
713jobs :
814 test :
915 name : Node.js ${{ matrix.node-version }}
@@ -14,22 +20,59 @@ jobs:
1420 node-version :
1521 - ' 24'
1622 steps :
17- - uses : actions/checkout@v6
23+ - name : Clone repository
24+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+ with :
26+ persist-credentials : false
27+ - name : Check GH actions
28+ uses : zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3
1829 - run : corepack enable
19- - uses : actions/setup-node@v6
30+ - name : Install Node.js
31+ uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
2032 with :
2133 node-version : ${{ matrix.node-version }}
2234 cache : yarn
2335 - run : yarn install --immutable
2436 - run : yarn lint
2537 - run : xvfb-run -a yarn test
2638 - run : yarn vsce-package
39+ - name : Validate package version matches git tag
40+ if : github.event_name == 'release'
41+ run : |
42+ PACKAGE_VERSION=$(jq -r .version package.json)
43+ if [ "$GITHUB_REF_NAME" != "v$PACKAGE_VERSION" ]; then
44+ echo "Error: Tag version ($TAG_VERSION) does not match package.json version (v$PACKAGE_VERSION)"
45+ exit 1
46+ fi
47+ - name : Upload VSIX
48+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
49+ if : github.event_name == 'release'
50+ with :
51+ name : vsix
52+ path : ' *.vsix'
53+ release :
54+ if : github.event_name == 'release'
55+ needs :
56+ - test
57+ name : Release
58+ runs-on : ubuntu-latest
59+ steps :
60+ - name : Download VSIX
61+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
62+ with :
63+ name : vsix
64+ - name : Install Node.js
65+ uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
66+ with :
67+ node-version : ' lts/*'
68+ - run : gh release upload "$GITHUB_REF_NAME" *.vsix
69+ - run : npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} -i *.vsix
2770 check :
2871 if : always()
2972 needs :
3073 - test
3174 runs-on : ubuntu-latest
3275 steps :
33- - uses : re-actors/alls-green@release/v1
76+ - uses : re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
3477 with :
3578 jobs : ${{ toJSON(needs) }}
0 commit comments