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

Limit length of PR body to GH maximum #92

Merged
merged 3 commits into from
Jun 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
7 changes: 6 additions & 1 deletion packages/action/src/util/get-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { ReleaseStats } from './types';
const capitalise = (str: string) =>
`${str.at(0)?.toUpperCase() || ''}${str.slice(1)}`;

// GitHub enforces a max length of 65536 characters for a pull request body
const maxLength = 65536;

export const makeGithubReleaseMessage = (stats: ReleaseStats) =>
`
${Object.entries(stats.pulls)
Expand All @@ -22,7 +25,9 @@ ${pulls.map(({ title }) => `- ${title}`).join('\n')}
${Array.from(stats.authors)
.map((author) => `@${author}`)
.join(', ')}
`.trim();
`
.trim()
.slice(0, maxLength);

const getReleaseMessage = async (prerelease: boolean) => {
const latestRelease = await getLatestRelease(prerelease);
Expand Down
Loading