我正在跟随HashiCorp的学习指南学习如何设置GitHub Actions和terraform。除了更新Terraform Plan的步骤之外,一切运行良好。
我遇到了以下错误:
An error occurred trying to start process '/home/runner/runners/2.287.1/externals/node12/bin/node' with working directory '/home/runner/work/ccoe-aws-ou-scp-manage/ccoe-aws-ou-scp-manage'. Argument list too long
我使用的代码是:
- uses: actions/github-script@0.9.0
if: github.event_name == 'pull_request'
env:
PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const output = `#### Terraform Format and Style \`${{ steps.fmt.outcome }}\`
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### Terraform Plan \`${{ steps.plan.outcome }}\`
<details><summary>Show Plan</summary>
\`\`\`${process.env.PLAN}\`\`\`
</details>
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
清晰地从文档中复制粘贴:https://learn.hashicorp.com/tutorials/terraform/github-actions
我已经尝试了版本5和6的actions/github-script,仍然存在相同的问题,但是当我复制黏贴计划时一切都很好。如果我不使用输出变量并为主体使用一些占位符文本,则一切正常。我可以看到step.plan.outputs.stdout如果我只打印那个。
如有需要,我将乐意分享更多细节。