Skip to content

Commit 6cf1c80

Browse files
authored
fix(scripts): mention generated is spread msg commit (#3421)
1 parent c6e65e0 commit 6cf1c80

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

scripts/ci/codegen/__tests__/spreadGeneration.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('spread generation', () => {
1414
expect(
1515
cleanUpCommitMessage('feat(ci): make ci push generated code (#244)', '')
1616
).toEqual(
17-
`feat(ci): make ci push generated code\n\nhttps://github.com/algolia/api-clients-automation/pull/244`
17+
`feat(ci): make ci push generated code (generated)\n\nhttps://github.com/algolia/api-clients-automation/pull/244`
1818
);
1919
});
2020

@@ -26,17 +26,17 @@ describe('spread generation', () => {
2626
it('cleans up correctly even if the title contains a url', () => {
2727
const commitMessage = `fix(java): solve oneOf using a custom generator https://algolia.atlassian.net/browse/APIC-123 (#200)`;
2828
expect(cleanUpCommitMessage(commitMessage, '')).toMatchInlineSnapshot(`
29-
"fix(java): solve oneOf using a custom generator https://algolia.atlassian.net/browse/APIC-123
29+
"fix(java): solve oneOf using a custom generator https://algolia.atlassian.net/browse/APIC-123 (generated)
3030
3131
https://github.com/algolia/api-clients-automation/pull/200"
3232
`);
3333
});
3434

3535
it('generated commits have a link to the origin pull request', () => {
3636
expect(
37-
cleanUpCommitMessage('feat(ci): make ci push generated code (#244) (generated).', '')
37+
cleanUpCommitMessage('feat(ci): make ci push generated code (#244) (generated)', '')
3838
).toEqual(
39-
`feat(ci): make ci push generated code\n\nhttps://github.com/algolia/api-clients-automation/pull/244`
39+
`feat(ci): make ci push generated code (generated)\n\nhttps://github.com/algolia/api-clients-automation/pull/244`
4040
);
4141
});
4242
});

scripts/ci/codegen/spreadGeneration.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { getNewReleasedTag } from '../../release/common.js';
1818
import type { Language } from '../../types.js';
1919
import { cloneRepository, getNbGitDiff } from '../utils.js';
2020

21-
import { commitStartRelease } from './text.js';
21+
import text, { commitStartRelease } from './text.js';
2222

2323
export function cleanUpCommitMessage(commitMessage: string, version: string): string {
2424
if (commitMessage.startsWith(commitStartRelease)) {
@@ -31,7 +31,9 @@ export function cleanUpCommitMessage(commitMessage: string, version: string): st
3131
return commitMessage;
3232
}
3333

34-
return [prCommit[1], `${REPO_URL}/pull/${prCommit[2]}`].join('\n\n');
34+
return [`${prCommit[1]} ${text.commitEndMessage}`, `${REPO_URL}/pull/${prCommit[2]}`].join(
35+
'\n\n',
36+
);
3537
}
3638

3739
async function spreadGeneration(): Promise<void> {

scripts/ci/codegen/text.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { TODAY } from '../../common.js';
33
export const commitStartPrepareRelease = 'chore: prepare release';
44
export const commitStartRelease = 'chore: release';
55

6-
const commitEndMessage = '(generated).';
6+
const commitEndMessage = '(generated)';
77

88
export default {
99
commitEndMessage,

scripts/release/__tests__/createReleasePR.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ describe('createReleasePR', () => {
133133
await parseCommit(
134134
buildTestCommit({
135135
type: 'feat(specs)',
136-
message: 'foo bar baz (generated).',
136+
message: 'foo bar baz (generated)',
137137
})
138138
)
139139
).toEqual({

0 commit comments

Comments
 (0)