feat: add truncate warning to pull request body

This commit is contained in:
Peter Evans 2023-10-19 16:55:00 +01:00
parent 21d8ea09d5
commit 9606fe7fd0
2 changed files with 8 additions and 2 deletions

View file

@ -52,7 +52,10 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
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