File tree 1 file changed +15
-8
lines changed
1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,21 @@ jobs:
24
24
name : Create tag
25
25
with :
26
26
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
+ }
35
42
}
36
43
const main = await github.rest.git.getRef({
37
44
owner: context.repo.owner,
You can’t perform that action at this time.
0 commit comments