File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737 - uses : actions/setup-node@v2
3838 with :
3939 node-version : 16.19.0
40+
41+ # Update package.json with the new version number
42+ - name : Update package.json
43+ uses :
44+ actions/github-script@v5
45+ with :
46+ github-token : ${{ secrets.GITHUB_TOKEN }}
47+ script : |
48+ const fs = require('fs');
49+ const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
50+ packageJson.version = '${{ github.event.inputs.tag }}';
51+ fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));
52+
53+ # Push the change to the main branch
54+ - name : Push changes to main
55+ run : |
56+ git config --local user.email "damandhillon08@gmail.com"
57+ git config --local user.name "Daman Dhillon"
58+ git add package.json
59+ git commit -m "Update package.json with version ${{ github.event.inputs.tag }}"
60+ git push
61+
62+
4063 # Install dependencies
4164 - run : npm install
4265 - run : npm install -g vsce
90113 upload_url : ${{ steps.create_release.outputs.upload_url }}
91114 asset_path : ./commit-extension-${{ github.event.inputs.tag }}.vsix
92115 asset_name : commit-extension-${{ github.event.inputs.tag }}.vsix
93- asset_content_type : application/zip
116+ asset_content_type : application/zip
117+
You can’t perform that action at this time.
0 commit comments