@@ -19,7 +19,13 @@ module.exports =
19
19
/******/ } ;
20
20
/******/
21
21
/******/ // Execute the module function
22
- /******/ modules [ moduleId ] . call ( module . exports , module , module . exports , __webpack_require__ ) ;
22
+ /******/ var threw = true ;
23
+ /******/ try {
24
+ /******/ modules [ moduleId ] . call ( module . exports , module , module . exports , __webpack_require__ ) ;
25
+ /******/ threw = false ;
26
+ /******/ } finally {
27
+ /******/ if ( threw ) delete installedModules [ moduleId ] ;
28
+ /******/ }
23
29
/******/
24
30
/******/ // Flag the module as loaded
25
31
/******/ module . l = true ;
@@ -34,7 +40,7 @@ module.exports =
34
40
/******/ // the startup function
35
41
/******/ function startup ( ) {
36
42
/******/ // Load entry module and return exports
37
- /******/ return __webpack_require__ ( 104 ) ;
43
+ /******/ return __webpack_require__ ( 198 ) ;
38
44
/******/ } ;
39
45
/******/
40
46
/******/ // run startup
@@ -954,87 +960,108 @@ module.exports = require("os");
954
960
955
961
/***/ } ) ,
956
962
957
- /***/ 104 :
958
- /***/ ( function ( __unusedmodule , __unusedexports , __webpack_require__ ) {
963
+ /***/ 129 :
964
+ /***/ ( function ( module ) {
959
965
960
- const core = __webpack_require__ ( 470 )
961
- const exec = __webpack_require__ ( 986 )
966
+ module . exports = require ( "child_process" ) ;
962
967
963
- function getTag ( tags , name ) {
964
- if ( name == "prev" ) {
965
- if ( tags . length < 2 ) {
966
- core . setFailed ( "need more than 2 tags." )
967
- return ""
968
- }
968
+ /***/ } ) ,
969
969
970
- return tags [ tags . length - 2 ]
971
- } else if ( name == "latest" ) {
972
- return tags [ tags . length - 1 ]
973
- } else {
974
- return name
975
- }
976
- }
970
+ /***/ 198 :
971
+ /***/ ( function ( __unusedmodule , exports , __webpack_require__ ) {
977
972
978
- async function run ( ) {
979
- const from = core . getInput ( "from" )
980
- const to = core . getInput ( "to" )
973
+ "use strict" ;
981
974
982
- let output = ''
983
- const options = { } ;
984
- options . listeners = {
985
- stdout : ( data ) => {
986
- output += data . toString ( ) ;
975
+ var __createBinding = ( this && this . __createBinding ) || ( Object . create ? ( function ( o , m , k , k2 ) {
976
+ if ( k2 === undefined ) k2 = k ;
977
+ Object . defineProperty ( o , k2 , { enumerable : true , get : function ( ) { return m [ k ] ; } } ) ;
978
+ } ) : ( function ( o , m , k , k2 ) {
979
+ if ( k2 === undefined ) k2 = k ;
980
+ o [ k2 ] = m [ k ] ;
981
+ } ) ) ;
982
+ var __setModuleDefault = ( this && this . __setModuleDefault ) || ( Object . create ? ( function ( o , v ) {
983
+ Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
984
+ } ) : function ( o , v ) {
985
+ o [ "default" ] = v ;
986
+ } ) ;
987
+ var __importStar = ( this && this . __importStar ) || function ( mod ) {
988
+ if ( mod && mod . __esModule ) return mod ;
989
+ var result = { } ;
990
+ if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . hasOwnProperty . call ( mod , k ) ) __createBinding ( result , mod , k ) ;
991
+ __setModuleDefault ( result , mod ) ;
992
+ return result ;
993
+ } ;
994
+ var __awaiter = ( this && this . __awaiter ) || function ( thisArg , _arguments , P , generator ) {
995
+ function adopt ( value ) { return value instanceof P ? value : new P ( function ( resolve ) { resolve ( value ) ; } ) ; }
996
+ return new ( P || ( P = Promise ) ) ( function ( resolve , reject ) {
997
+ function fulfilled ( value ) { try { step ( generator . next ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
998
+ function rejected ( value ) { try { step ( generator [ "throw" ] ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
999
+ function step ( result ) { result . done ? resolve ( result . value ) : adopt ( result . value ) . then ( fulfilled , rejected ) ; }
1000
+ step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
1001
+ } ) ;
1002
+ } ;
1003
+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1004
+ const core = __importStar ( __webpack_require__ ( 470 ) ) ;
1005
+ const exec = __importStar ( __webpack_require__ ( 986 ) ) ;
1006
+ function getTag ( tags , name ) {
1007
+ if ( name === 'prev' ) {
1008
+ if ( tags . length < 2 ) {
1009
+ core . setFailed ( 'need more than 2 tags.' ) ;
1010
+ return '' ;
987
1011
}
1012
+ return tags [ tags . length - 2 ] ;
988
1013
}
989
-
990
- const tag_command = 'git tag --sort version:refname'
991
- console . log ( tag_command )
992
- await exec . exec ( tag_command , [ ] , options ) . catch ( error => {
993
- core . setFailed ( error . message )
994
- } )
995
-
996
- const tags = output . split ( '\n' ) . filter ( Boolean )
997
- console . log ( tags )
998
-
999
- output = ''
1000
-
1001
- const from_tag = getTag ( tags , from )
1002
- const to_tag = getTag ( tags , to )
1003
-
1004
- if ( from_tag . length == 0 || to_tag . length == 0 ) {
1005
- core . setFailed ( "from or to is invalid" )
1006
- return
1014
+ else if ( name === 'latest' ) {
1015
+ return tags [ tags . length - 1 ] ;
1016
+ }
1017
+ else {
1018
+ return name ;
1007
1019
}
1008
-
1009
- const command = `git log ${ from_tag } ..${ to_tag } --merges --reverse --pretty=format:"* %b"`
1010
- console . log ( command )
1011
-
1012
- await exec . exec ( command , [ ] , options ) . catch ( error => {
1013
- core . setFailed ( error . message )
1014
- } )
1015
-
1016
- console . log ( output )
1017
-
1018
- output = output . replace ( / % / g, '%25' )
1019
- output = output . replace ( / \n / g, '%0A' )
1020
- output = output . replace ( / \r / g, '%0D' )
1021
-
1022
- console . log ( output )
1023
-
1024
- const setoutput_command = `echo "::set-output name=diff::${ output } "`
1025
- exec . exec ( setoutput_command ) . catch ( error => {
1026
- core . setFailed ( error . message )
1027
- } )
1028
1020
}
1021
+ function run ( ) {
1022
+ return __awaiter ( this , void 0 , void 0 , function * ( ) {
1023
+ const from = core . getInput ( 'from' ) ;
1024
+ const to = core . getInput ( 'to' ) ;
1025
+ let output = '' ;
1026
+ const options = {
1027
+ listeners : {
1028
+ stdout : ( data ) => {
1029
+ output += data . toString ( ) ;
1030
+ }
1031
+ }
1032
+ } ;
1033
+ const tagCommand = 'git tag --sort version:refname' ;
1034
+ core . info ( tagCommand ) ;
1035
+ yield exec . exec ( tagCommand , [ ] , options ) . catch ( error => {
1036
+ core . setFailed ( error . message ) ;
1037
+ } ) ;
1038
+ const tags = output . split ( '\n' ) . filter ( Boolean ) ;
1039
+ core . info ( tags . toString ( ) ) ;
1040
+ output = '' ;
1041
+ const fromTag = getTag ( tags , from ) ;
1042
+ const toTag = getTag ( tags , to ) ;
1043
+ if ( fromTag . length === 0 || toTag . length === 0 ) {
1044
+ core . setFailed ( 'from or to is invalid' ) ;
1045
+ return ;
1046
+ }
1047
+ const command = `git log ${ fromTag } ..${ toTag } --merges --reverse --pretty=format:"* %b"` ;
1048
+ core . info ( command ) ;
1049
+ yield exec . exec ( command , [ ] , options ) . catch ( error => {
1050
+ core . setFailed ( error . message ) ;
1051
+ } ) ;
1052
+ core . info ( output ) ;
1053
+ output = output . replace ( / % / g, '%25' ) ;
1054
+ output = output . replace ( / \n / g, '%0A' ) ;
1055
+ output = output . replace ( / \r / g, '%0D' ) ;
1056
+ core . info ( output ) ;
1057
+ const setoutputCommand = `echo "::set-output name=diff::${ output } "` ;
1058
+ exec . exec ( setoutputCommand ) . catch ( error => {
1059
+ core . setFailed ( error . message ) ;
1060
+ } ) ;
1061
+ } ) ;
1062
+ }
1063
+ run ( ) ;
1029
1064
1030
- run ( )
1031
-
1032
- /***/ } ) ,
1033
-
1034
- /***/ 129 :
1035
- /***/ ( function ( module ) {
1036
-
1037
- module . exports = require ( "child_process" ) ;
1038
1065
1039
1066
/***/ } ) ,
1040
1067
0 commit comments