Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions scripts/ci/codegen/pushGeneratedCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,22 @@ export async function pushGeneratedCode(): Promise<void> {
return;
}

const skipCi = isMainBranch ? '[skip ci]' : '';
let message = await run(`git show -s ${baseBranch} --format="%s ${text.commitEndMessage} ${skipCi}"`);
const authors = await run(
`git show -s ${baseBranch} --format="
Co-authored-by: %an <%ae>
%(trailers:key=Co-authored-by)"`,
);

if (IS_RELEASE_COMMIT && isMainBranch) {
let baseMessage = `%s ${text.commitEndMessage}`;
if (IS_RELEASE_COMMIT || isMainBranch) {
console.log('Processing release commit');
message = `${text.commitReleaseMessage} [skip ci]`;
baseMessage = `${text.commitReleaseMessage} [skip ci]`;
}

message += authors;
const commitMessage = await run(
`git show -s ${baseBranch} --format="${baseMessage}

Co-authored-by: %an <%ae>
%(trailers:key=Co-authored-by)"`,
);

console.log(`Pushing code to generated branch: '${branchToPush}'`);
await run('git add .');
await run(`git commit -m "${message.replaceAll('"', '\\"')}"`);
await run(`git commit -m "${commitMessage.replaceAll('"', '\\"')}"`);
await run(`git push origin ${branchToPush}`);

setOutput('GENERATED_COMMIT', await run('git rev-parse HEAD'));
Expand Down
Loading