upload-artifact
upload-artifact copied to clipboard
Artifact JSON files contaminated with log prints
Describe the bug Artifacts content contain log prints of the GitHub action process
Version
- V2
Environment
- Linux
How to reproduce
Create a workflow with the following steps :
- name: Terraform Plan
id: plan
if: github.event_name == 'pull_request'
run: |
terraform plan -out=plan.out
terraform show -json plan.out > plan.json
- name: Save plan json
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v2
with:
name: tf-plan-json
path: |
plan.json
Additional context
Example of logs contained in the file


Hello,
It could be a solution if you use the setup-terraform action from hashicorp as it has an option terraform_wrapper: false which in result will filter out those lines(more accurately it will not generate those)
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.9
terraform_wrapper: false
Src: https://stackoverflow.com/questions/66496105/how-can-i-remove-all-the-extraneous-output-from-redirected-output-in-github-acti
TF action: https://github.com/hashicorp/setup-terraform
Worked!