File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ Options:
65
65
--skipDuplicatedAssets Pass this flag if you don't want the plugin to replace assets with the same
66
66
name. False by default.
67
67
68
+ --skipIfPublished Pass this flag if you don't want a new release to be created if a release with
69
+ the same tag has already been published (is not a draft). False by default.
70
+
68
71
--editRelease Pass this flag if you want to edit release name, notes, type and target_commitish.
69
72
It will need reuseRelease or/and reuseDraftOnly true to edit the release.
70
73
@@ -103,6 +106,7 @@ publishRelease({
103
106
reuseDraftOnly: true ,
104
107
skipAssetsCheck: false ,
105
108
skipDuplicatedAssets: false ,
109
+ skipIfPublished: false ,
106
110
editRelease: false ,
107
111
deleteEmptyTag: false ,
108
112
assets: [' /absolute/path/to/file' ],
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ Options:
39
39
--skipDuplicatedAssets Pass this flag if you don't want the plugin to replace assets with the same
40
40
name. False by default.
41
41
42
+ --skipIfPublished Pass this flag if you don't want a new release to be created if a release with
43
+ the same tag has already been published (is not a draft). False by default.
44
+
42
45
--editRelease Pass this flag if you want to edit release name, notes, type and target_commitish.
43
46
It will need reuseRelease or/and reuseDraftOnly true to edit the release.
44
47
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ var opts = _.extend({
34
34
prerelease : false ,
35
35
reuseRelease : false ,
36
36
skipAssetsCheck : false ,
37
+ skipIfPublished : false ,
37
38
skipDuplicatedAssets : false ,
38
39
editRelease : false ,
39
40
deleteEmptyTag : false ,
Original file line number Diff line number Diff line change @@ -123,14 +123,14 @@ PublishRelease.prototype.publish = function publish () {
123
123
} )
124
124
125
125
var statusOk = res . statusCode >= 200 && res . statusCode < 300
126
- var bodyOk = bodyReturn && bodyReturn . tag_name === opts . tag
126
+ var hasReleaseMatchingTag = bodyReturn && bodyReturn . tag_name === opts . tag
127
127
var canReuse = ! opts . reuseDraftOnly || ( bodyReturn && bodyReturn . draft )
128
128
129
- if ( statusOk && bodyOk && canReuse ) {
129
+ if ( statusOk && hasReleaseMatchingTag && canReuse ) {
130
130
self . emit ( 'reuse-release' )
131
131
bodyReturn . allowReuse = true // allow to editRelease
132
132
callback ( null , bodyReturn )
133
- } else {
133
+ } else if ( ! hasReleaseMatchingTag || hasReleaseMatchingTag && ! opts . skipIfPublished ) {
134
134
requestCreateRelease ( )
135
135
}
136
136
} )
You can’t perform that action at this time.
0 commit comments