@@ -53,24 +53,22 @@ export async function pushGeneratedCode(): Promise<void> {
53
53
return ;
54
54
}
55
55
56
- const skipCi = isMainBranch ? '[skip ci]' : '' ;
57
- let message = await run ( `git show -s ${ baseBranch } --format="%s ${ text . commitEndMessage } ${ skipCi } "` ) ;
58
- const authors = await run (
59
- `git show -s ${ baseBranch } --format="
60
- Co-authored-by: %an <%ae>
61
- %(trailers:key=Co-authored-by)"` ,
62
- ) ;
63
-
64
- if ( IS_RELEASE_COMMIT && isMainBranch ) {
56
+ let baseMessage = `%s ${ text . commitEndMessage } ` ;
57
+ if ( IS_RELEASE_COMMIT || isMainBranch ) {
65
58
console . log ( 'Processing release commit' ) ;
66
- message = `${ text . commitReleaseMessage } [skip ci]` ;
59
+ baseMessage = `${ text . commitReleaseMessage } [skip ci]` ;
67
60
}
68
61
69
- message += authors ;
62
+ const commitMessage = await run (
63
+ `git show -s ${ baseBranch } --format="${ baseMessage }
64
+
65
+ Co-authored-by: %an <%ae>
66
+ %(trailers:key=Co-authored-by)"` ,
67
+ ) ;
70
68
71
69
console . log ( `Pushing code to generated branch: '${ branchToPush } '` ) ;
72
70
await run ( 'git add .' ) ;
73
- await run ( `git commit -m "${ message . replaceAll ( '"' , '\\"' ) } "` ) ;
71
+ await run ( `git commit -m "${ commitMessage . replaceAll ( '"' , '\\"' ) } "` ) ;
74
72
await run ( `git push origin ${ branchToPush } ` ) ;
75
73
76
74
setOutput ( 'GENERATED_COMMIT' , await run ( 'git rev-parse HEAD' ) ) ;
0 commit comments