Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: newlines before coauthor [skip-bc] #3986

Merged
merged 5 commits into from
Oct 17, 2024
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
21 changes: 13 additions & 8 deletions scripts/ci/codegen/pushGeneratedCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,26 @@ export async function pushGeneratedCode(): Promise<void> {
return;
}

let baseMessage = IS_RELEASE_COMMIT && isMainBranch ? text.commitReleaseMessage : `%s ${text.commitEndMessage}`;

const commitMessage = await run(
`git show -s ${baseBranch} --format="${baseMessage}
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>
skip-checks: true
%(trailers:key=Co-authored-by)
%(trailers:key=skip-checks)"`,
%(trailers:key=Co-authored-by)"`,
);

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

message += authors;

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

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