File tree Expand file tree Collapse file tree 3 files changed +36
-13
lines changed
Expand file tree Collapse file tree 3 files changed +36
-13
lines changed Original file line number Diff line number Diff line change 4646 name : Package
4747 runs-on : ubuntu-22.04
4848 needs : [lint, test]
49- outputs :
50- packageName : ${{ steps.setup.outputs.packageName }}
51- version : ${{ steps.version.outputs.version }}
5249 steps :
5350 - uses : actions/checkout@v5
5451
Original file line number Diff line number Diff line change 2323 with :
2424 node-version : " 22"
2525
26- - name : Install dependencies
27- run : |
28- yarn
29- npm install -g @vscode/vsce
30-
3126 - name : Extract version from tag
3227 id : version
3328 run : |
3732 echo "version=$VERSION" >> $GITHUB_OUTPUT
3833 echo "Pre-release version: $VERSION"
3934
35+ - name : Validate version matches package.json
36+ run : |
37+ TAG_VERSION="${{ steps.version.outputs.version }}"
38+ PACKAGE_VERSION=$(node -e "console.log(require('./package.json').version)")
39+
40+ if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
41+ echo "Error: Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
42+ echo "Please ensure the tag version matches the version in package.json"
43+ exit 1
44+ fi
45+
46+ echo "Version validation successful: $TAG_VERSION"
47+
48+ - name : Install dependencies
49+ run : |
50+ yarn
51+ npm install -g @vscode/vsce
52+
4053 - name : Setup package path
4154 id : setup
4255 run : |
Original file line number Diff line number Diff line change 2424 with :
2525 node-version : " 22"
2626
27- - name : Install dependencies
28- run : |
29- yarn
30- npm install -g @vscode/vsce
31-
3227 - name : Extract version from tag
3328 id : version
3429 run : |
3732 echo "version=$VERSION" >> $GITHUB_OUTPUT
3833 echo "Release version: $VERSION"
3934
35+ - name : Validate version matches package.json
36+ run : |
37+ TAG_VERSION="${{ steps.version.outputs.version }}"
38+ PACKAGE_VERSION=$(node -e "console.log(require('./package.json').version)")
39+
40+ if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
41+ echo "Error: Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
42+ echo "Please ensure the tag version matches the version in package.json"
43+ exit 1
44+ fi
45+
46+ echo "Version validation successful: $TAG_VERSION"
47+
48+ - name : Install dependencies
49+ run : |
50+ yarn
51+ npm install -g @vscode/vsce
52+
4053 - name : Setup package path
4154 id : setup
4255 run : |
You can’t perform that action at this time.
0 commit comments