Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save slawekzachcial/c77d5ada910f3983de6703da073f9d95 to your computer and use it in GitHub Desktop.
Save slawekzachcial/c77d5ada910f3983de6703da073f9d95 to your computer and use it in GitHub Desktop.
terraform plan -no-color 2>&1 \
| sed -E -e 's/^([[:space:]]+)([-+#])/\2\1/g' -e 's/^([[:space:]]+)~/!\1/g'
@slawekzachcial
Copy link
Author

slawekzachcial commented Apr 26, 2022

The output of above command, wrapped in code block with "diff" syntax in a GitHub PR or comment creates the output similar to the below:
image

Source: https://blog.testdouble.com/posts/2021-12-07-elevate-your-terraform-workflow-with-github-actions/#re-introduce-colors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment