File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed
Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,21 @@ jobs:
2424 name : Create tag
2525 with :
2626 script : |
27- const tag = await github.rest.git.getRef({
28- owner: context.repo.owner,
29- repo: context.repo.repo,
30- ref: 'tags/${{ steps.version.outputs.VERSION }}'
31- });
32- if (tag != null && tag.status == 200) {
33- console.error('Tag ${{ steps.version.outputs.VERSION }} already exists.');
34- return;
27+ try {
28+ const tag = await github.rest.git.getRef({
29+ owner: context.repo.owner,
30+ repo: context.repo.repo,
31+ ref: 'tags/${{ steps.version.outputs.VERSION }}'
32+ });
33+ if (tag != null && tag.status == 200) {
34+ console.log('Tag ${{ steps.version.outputs.VERSION }} already exists.');
35+ return;
36+ }
37+ } catch (error) {
38+ if (error.status !== 404) {
39+ console.error('Error when trying to get tag ${{ steps.version.outputs.VERSION }}.');
40+ return;
41+ }
3542 }
3643 const main = await github.rest.git.getRef({
3744 owner: context.repo.owner,
You can’t perform that action at this time.
0 commit comments