File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,25 @@ jobs:
4848 name : commit-extension-${{ github.event.inputs.tag }}
4949 path : ./
5050
51- # Check if the release already exists
51+ # Check if the tag already exists
5252 - name : Check if release exists
5353 id : check_release
54- uses : softprops/action-gh-release@v1
54+ uses : actions/github-script@v5
5555 with :
56- tag_name : ${{ github.event.inputs.tag }}
57- env :
58- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56+ github-token : ${{ secrets.GITHUB_TOKEN }}
57+ script : |
58+ const release = await github.repos.getReleaseByTag({
59+ owner: context.repo.owner,
60+ repo: context.repo.repo,
61+ tag: context.ref.replace('refs/tags/', '')
62+ }).catch(err => {
63+ if (err.status === 404) {
64+ return null;
65+ }
66+ throw err;
67+ });
68+ console.log('Release exists: ' + (release !== null));
69+ return release ? { exists: 'true' } : { exists: 'false' };
5970
6071 # Upload the VSIX file to the Github release
6172 - name : Create Release
You can’t perform that action at this time.
0 commit comments