Skip to content

Commit

Permalink
Limit length of PR body to GH maximum (#92)
Browse files Browse the repository at this point in the history
CI fails if a generated pull request's body exceeds GH's limit. We should prevent this to avoid causing CI to fail in those cases. See [Slack thread](https://whop-workspace.slack.com/archives/C034QJEQDM5/p1718403943370069).
  • Loading branch information
sergeichestakov authored Jun 17, 2024
1 parent 2fead15 commit cefc9e6
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit cefc9e6

Please sign in to comment.