terraform-aws-runtask-tf-plan-analyzer
terraform-aws-runtask-tf-plan-analyzer copied to clipboard
RFE: Post results as comment back to GitHub Pullrequest
Hi,
The run task looks promising in understanding specific changes better. I had a quick look at https://developer.hashicorp.com/terraform/cloud-docs/integrations/run-tasks#integration-details and saw that the payload for the run task would also include VCS information like commit and PR URLs. If it's a speculative plan, it would be great to also send the results back as a comment to the originating PR. What do you think?
Best regards, Johannes
that is a good suggestion, thank you @jgrumboe
we have a few potential way to do it:
- Since we know the workspace id, we could push comment on the Workspace run, or
- As you suggested, bubble up the finding as pull request on the originating PR
Thinking of our dev teams, the PR is the "source of truth" 🙂
The workspace comments are not used at all here.
if you are using the tfc-workflow-tooling , we might able to bubble up the RunTasks plan output as part of it (which today is not yet available).
Ref: https://github.com/hashicorp/tfc-workflows-tooling/blob/main/docs/USAGE.md#available-commands
cc @gautambaghel
We're not using the tf-workflow-tooling; our workspaces are "normal" VCS connected.
Hey @jgrumboe I opened a new PR #13 to address this, would this satisfy your requirement? The additional piece would be that you need to supply the GitHub token.
It needs to be a Fine-grained personal access tokens
with access to
- Read access to metadata
- Read and Write access to pull requests
@gautambaghel Thanks, and sorry for coming back here so late. I will give it a try in the next weeks.