Strip spaces from comment body for better formatting

This commit is contained in:
Nick Bolton 2024-09-06 14:13:13 +01:00
parent e23722c07a
commit b74eb9bfb4

View file

@ -35,16 +35,20 @@ jobs:
if: steps.issue-check.outputs.may-need-tech-support == 'true' if: steps.issue-check.outputs.may-need-tech-support == 'true'
env: env:
COMMENT_BODY: | COMMENT_BODY: |
Hello, as a customer, you're entitled to tech support which is included in your Hello! :wave: As a customer, you're entitled to tech support which is included in your
license. Please [raise a support ticket](https://symless.com/synergy/contact) license at no extra cost.
if you'd like to take advantage of that. If that works for you, then please let Please [raise a support ticket](https://symless.com/synergy/contact) if you'd like to
us know your ticket number so we can continue the discussion there. take advantage of that.
If that works for you, then please let us know your ticket number so we can continue
the discussion there. Thanks!
uses: actions/github-script@v6 uses: actions/github-script@v6
with: with:
script: | script: |
body = process.env.COMMEN_BODY
body = body.replace(/\\n/g, '\n')
github.rest.issues.createComment({ github.rest.issues.createComment({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
issue_number: context.issue.number || process.env.ISSUE_NUMBER, issue_number: context.issue.number || github.event.inputs.issue_number,
body: process.env.COMMENT_BODY body
}); });