How to use multiline variable in a script #458
Unanswered
baxelrod-bdai
asked this question in
Q&A
Replies: 1 comment
-
I'd recommend passing inputs through an environment variable into your script rather than inlining the expression. https://github.com/actions/github-script#use-env-as-input For example: - name: Step3
uses: actions/github-script@v6
env:
LONG_OUTPUT: ${{ steps.stepone.outputs.long2 }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: process.env.LONG_OUTPUT
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am having trouble using a multiline variable in the
script
part of actionactions/github-script@v6
.I found out how to convert it to a one line string, and this works fine in the
run
part of a second step. For example, this works:However, when I try to display this in a PR comment, I get an error.
Beta Was this translation helpful? Give feedback.
All reactions