File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 9
9
description : " to tag"
10
10
required : false
11
11
default : " latest"
12
+ first-parent :
13
+ description : " whether use --first-parent ro not"
14
+ required : false
15
+ default : true
12
16
runs :
13
17
using : " node12"
14
18
main : " dist/index.js"
Original file line number Diff line number Diff line change @@ -1022,6 +1022,7 @@ function run() {
1022
1022
return __awaiter ( this , void 0 , void 0 , function * ( ) {
1023
1023
const from = core . getInput ( 'from' ) ;
1024
1024
const to = core . getInput ( 'to' ) ;
1025
+ const shouldUseFirstParent = core . getInput ( 'first-parent' ) ;
1025
1026
let output = '' ;
1026
1027
const options = {
1027
1028
listeners : {
@@ -1044,7 +1045,8 @@ function run() {
1044
1045
core . setFailed ( 'from or to is invalid' ) ;
1045
1046
return ;
1046
1047
}
1047
- const command = `git log ${ fromTag } ..${ toTag } --merges --reverse --pretty=format:"* %b"` ;
1048
+ const firstParentOption = shouldUseFirstParent ? '--first-parent' : '' ;
1049
+ const command = `git log ${ fromTag } ..${ toTag } --merges ${ firstParentOption } --reverse --pretty=format:"* %b"` ;
1048
1050
core . info ( command ) ;
1049
1051
yield exec . exec ( command , [ ] , options ) . catch ( error => {
1050
1052
core . setFailed ( error . message ) ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ function getTag(tags: string[], name: string): string {
19
19
async function run ( ) : Promise < void > {
20
20
const from = core . getInput ( 'from' )
21
21
const to = core . getInput ( 'to' )
22
+ const shouldUseFirstParent = core . getInput ( 'first-parent' )
22
23
23
24
let output = ''
24
25
const options = {
@@ -48,7 +49,8 @@ async function run(): Promise<void> {
48
49
return
49
50
}
50
51
51
- const command = `git log ${ fromTag } ..${ toTag } --merges --reverse --pretty=format:"* %b"`
52
+ const firstParentOption = shouldUseFirstParent ? '--first-parent' : ''
53
+ const command = `git log ${ fromTag } ..${ toTag } --merges ${ firstParentOption } --reverse --pretty=format:"* %b"`
52
54
core . info ( command )
53
55
54
56
await exec . exec ( command , [ ] , options ) . catch ( error => {
You can’t perform that action at this time.
0 commit comments