Skip to content

Commit f03e450

Browse files
committed
use the commitReleaseMessage
1 parent d3dbb95 commit f03e450

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

scripts/ci/codegen/pushGeneratedCode.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,24 @@ export async function pushGeneratedCode(): Promise<void> {
5454
return;
5555
}
5656

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}
65-
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="
6661
Co-authored-by: %an <%ae>
6762
%(trailers:key=Co-authored-by)"`,
6863
);
6964

65+
if (IS_RELEASE_COMMIT && isMainBranch) {
66+
console.log('Processing release commit');
67+
message = `${text.commitReleaseMessage} [skip ci]`;
68+
}
69+
70+
message += authors;
71+
7072
console.log(`Pushing code to generated branch: '${branchToPush}'`);
7173
await run('git add .');
72-
await run(`git commit -m "${commitMessage.replaceAll('"', '\\"')}"`);
74+
await run(`git commit -m "${message.replaceAll('"', '\\"')}"`);
7375
await run(`git push origin ${branchToPush}`);
7476

7577
setOutput('GENERATED_COMMIT', await run('git rev-parse HEAD'));

0 commit comments

Comments
 (0)