File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ inputs:
1717 description : ' Skip the unshallow operation: "true" or "false"'
1818 required : false
1919 default : " false"
20- long :
21- description : " Return long format tag: <tagName>-<revisionsSinceTag>-<currentCommit> "
20+ abbrev :
21+ description : " value to pass to the --abbrev flag. false to disable, default 0 "
2222 required : false
23- default : " false "
23+ default : 0
2424
2525outputs :
2626 tag :
Original file line number Diff line number Diff line change @@ -18,13 +18,13 @@ try {
1818 const include = getInput ( "include" ) ;
1919 const exclude = getInput ( "exclude" ) ;
2020 const commitIsh = getInput ( "commit-ish" ) ;
21- const long = getInput ( "long" ) === "true" ;
21+ const abbrev = getInput ( "abbrev" ) ;
2222 const skipUnshallow = getInput ( "skip-unshallow" ) === "true" ;
2323
2424 var includeOption = "" ;
2525 var excludeOption = "" ;
2626 var commitIshOption = "" ;
27- var abbrevOption = long ? "" : "--abbrev=0 ";
27+ var abbrevOption = " ";
2828
2929 if ( typeof include === "string" && include . length > 0 ) {
3030 includeOption = `--match '${ include } '` ;
4343 commitIshOption = `'${ commitIsh } '` ;
4444 }
4545
46+ if ( abbrev !== false ) {
47+ abbrevOption = `--abbrev=${ abbrev } ` ;
48+ }
49+
4650 var unshallowCmd = skipUnshallow ? "" : "git fetch --prune --unshallow &&" ;
4751
4852 // actions@checkout performs a shallow checkout. Need to unshallow for full tags access.
You can’t perform that action at this time.
0 commit comments