Skip to content

Commit d49513a

Browse files
authored
chore: newlines before coauthor [skip-bc] (#3986)
1 parent 1dfdf44 commit d49513a

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

scripts/ci/codegen/pushGeneratedCode.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,26 @@ export async function pushGeneratedCode(): Promise<void> {
5353
return;
5454
}
5555

56-
let baseMessage = IS_RELEASE_COMMIT && isMainBranch ? text.commitReleaseMessage : `%s ${text.commitEndMessage}`;
57-
58-
const commitMessage = await run(
59-
`git show -s ${baseBranch} --format="${baseMessage}
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="
6060
6161
6262
Co-authored-by: %an <%ae>
63-
skip-checks: true
64-
%(trailers:key=Co-authored-by)
65-
%(trailers:key=skip-checks)"`,
63+
%(trailers:key=Co-authored-by)"`,
6664
);
6765

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

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

0 commit comments

Comments
 (0)