File tree Expand file tree Collapse file tree 1 file changed +17
-12
lines changed
Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -27,21 +27,26 @@ export const push = async (
2727}
2828
2929export const pushTags = async ( ) => {
30+ // Get the commit hash
31+ const { stdout : commitHash } = await execWithOutput ( "git" , [
32+ "rev-parse" ,
33+ "HEAD" ,
34+ ] ) ;
3035 // Get the tags that contain the commit
31- const { stdout : tags } = await execWithOutput ( 'git' , [
32- '--no-pager' ,
33- 'tag' ,
34- `HEAD` ,
35- ] )
36+ const { stdout : tags } = await execWithOutput ( "git" , [
37+ "--no-pager" ,
38+ "tag" ,
39+ "--contains" ,
40+ commitHash ,
41+ ] ) ;
3642 // Separate the tags into a list
37- const tagList = tags . split ( '\n' )
38- if ( tagList . length > 0 ) {
39- // Push the tags individually to the remote
40- for ( const tag of tagList ) {
41- await exec ( 'git' , [ 'push' , 'origin' , tag ] )
42- }
43+ const tagList = tags . split ( "\n" ) ;
44+ // Push the tags individually to the remote
45+ for ( const tag of tagList ) {
46+ await exec ( "git" , [ "push" , "origin" , tag ] ) ;
4347 }
44- }
48+ } ;
49+
4550
4651export const switchToMaybeExistingBranch = async ( branch : string ) => {
4752 const { stderr } = await execWithOutput ( 'git' , [ 'checkout' , branch ] , {
You can’t perform that action at this time.
0 commit comments