File tree Expand file tree Collapse file tree 1 file changed +21
-5
lines changed
Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change 1919jobs :
2020 publish :
2121 runs-on : ubuntu-latest
22+ permissions :
23+ contents : write
24+ actions : read
2225
2326 steps :
2427 - name : Checkout code
@@ -64,11 +67,23 @@ jobs:
6467
6568 - name : Create Git Tag (for releases only)
6669 if : github.event.inputs.release_type == 'release'
67- run : |
68- git config --local user.email "[email protected] " 69- git config --local user.name "GitHub Action"
70- git tag "v${{ github.event.inputs.version }}"
71- git push origin "v${{ github.event.inputs.version }}"
70+ uses : actions/github-script@v7
71+ with :
72+ script : |
73+ const tag = `v${{ github.event.inputs.version }}`;
74+ const ref = `refs/tags/${tag}`;
75+
76+ try {
77+ await github.rest.git.createRef({
78+ owner: context.repo.owner,
79+ repo: context.repo.repo,
80+ ref: ref,
81+ sha: context.sha
82+ });
83+ console.log(`Created tag: ${tag}`);
84+ } catch (error) {
85+ console.log(`Tag ${tag} might already exist: ${error.message}`);
86+ }
7287
7388 - name : Create GitHub Release (for releases only)
7489 if : github.event.inputs.release_type == 'release'
7792 tag_name : " v${{ github.event.inputs.version }}"
7893 files : " *.vsix"
7994 generate_release_notes : true
95+ make_latest : true
8096 env :
8197 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8298
You can’t perform that action at this time.
0 commit comments