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