feat: add truncate warning to pull request body

This commit is contained in:
Peter Evans 2023-10-19 16:55:00 +01:00
parent 0d8f34ad33
commit 14d246ba11
2 changed files with 8 additions and 2 deletions

5
dist/index.js vendored
View file

@ -337,7 +337,10 @@ function createPullRequest(inputs) {
// 65536 characters is the maximum allowed for the pull request body.
if (inputs.body.length > 65536) {
core.warning(`Pull request body is too long. Truncating to 65536 characters.`);
inputs.body = inputs.body.substring(0, 65536);
const truncateWarning = '...*[Pull request body truncated]*';
inputs.body =
inputs.body.substring(0, 65536 - truncateWarning.length) +
truncateWarning;
}
// Get the repository path
const repoPath = utils.getRepoPath(inputs.path);