Commit 89aa683 1 parent 124ea0f commit 89aa683 Copy full SHA for 89aa683
File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -90,11 +90,21 @@ export async function run(
90
90
let buildOptions = null ;
91
91
92
92
// If we are pushing directly to the target branch then just build a release without draft flag
93
- if ( context . eventName === 'push' && context . ref === `refs/heads/${ target } ` ) {
93
+ if (
94
+ context . eventName === 'push' &&
95
+ ( context . ref === `refs/heads/${ target } ` ||
96
+ context . ref . startsWith ( '/refs/tags/' ) )
97
+ ) {
98
+ // TODO: Update this to use ref_type & ref_name once that becomes available
99
+ // See: https://github.com/actions/toolkit/pull/935/files
100
+ const tagName = context . ref . match ( / ^ \/ r e f s \/ t a g s \/ ( \w + ) / ) ?. [ 1 ] ;
94
101
// Make a final release because context is master workflow
95
102
buildOptions = {
96
103
draft : false ,
97
- tags : { sha : context . sha } ,
104
+ tags : {
105
+ sha : context . sha ,
106
+ ...( ! ! tagName && { tag : tagName } ) ,
107
+ } ,
98
108
} ;
99
109
} else if ( context . eventName !== 'pull_request' ) {
100
110
// Make sure the only events now are Pull Requests
You can’t perform that action at this time.
0 commit comments