File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,11 @@ function createPullRequest(inputs) {
334334 // Update the body input with the contents of the file
335335 inputs.body = utils.readFile(inputs.bodyPath);
336336 }
337+ // 65536 characters is the maximum allowed for the pull request body.
338+ if (inputs.body.length > 65536) {
339+ core.warning(`Pull request body is too long. Truncating to 65536 characters.`);
340+ inputs.body = inputs.body.substring(0, 65536);
341+ }
337342 // Get the repository path
338343 const repoPath = utils.getRepoPath(inputs.path);
339344 // Create a git command manager
Original file line number Diff line number Diff line change @@ -46,6 +46,13 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
4646 // Update the body input with the contents of the file
4747 inputs . body = utils . readFile ( inputs . bodyPath )
4848 }
49+ // 65536 characters is the maximum allowed for the pull request body.
50+ if ( inputs . body . length > 65536 ) {
51+ core . warning (
52+ `Pull request body is too long. Truncating to 65536 characters.`
53+ )
54+ inputs . body = inputs . body . substring ( 0 , 65536 )
55+ }
4956
5057 // Get the repository path
5158 const repoPath = utils . getRepoPath ( inputs . path )
You can’t perform that action at this time.
0 commit comments