terraform-plan-comment icon indicating copy to clipboard operation
terraform-plan-comment copied to clipboard

idea: Support for adding to the summary page of a workflow run

Open jabbermouth opened this issue 1 year ago • 5 comments

Add ability to post the markdown as a job summary: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary

jabbermouth avatar Jun 22 '24 08:06 jabbermouth

@jabbermouth Something like this?

image Screenshot of TF plan in a GitHub Action workflow's job summary.

rdhar avatar Jun 25 '24 17:06 rdhar

Yep 👍 Basically, what goes in the PR but on the run summary page.

jabbermouth avatar Jun 25 '24 17:06 jabbermouth

Might be worth giving TF-via-PR GitHub Action a go; the above screenshot is taken directly from a recent workflow run to demo a realistic use-case.

You can probably tell I'm the author, which is why I'm on the look-out for use-cases/feature-requests that users are seeking for these sort of Actions.

rdhar avatar Jun 25 '24 17:06 rdhar

Thanks, I'll take a look.

jabbermouth avatar Jun 25 '24 21:06 jabbermouth

This sounds very reasonable! And I think it can be nicely combined with the request in #12 :eyes:

borchero avatar Aug 13 '24 23:08 borchero

I would love to see this. Using a single action to print to both comments on a PR, and summary on a run without a PR would be great.

joryirving avatar Oct 29 '24 15:10 joryirving

@joryirving You're in luck, both are supported here!

rdhar avatar Oct 29 '24 15:10 rdhar

Sure, but that's a different action than this repo. I'd rather not refactor for a new action if I don't need to.

joryirving avatar Oct 29 '24 16:10 joryirving

@joryirving That's totally fair. Might be pleasantly surprised by how little there is to "refactor", but I understand replacing and trialling a GH Action takes time.

Worth noting, it does a li'l more than just render a plan as a comment—it streamlines Terraform/Tofu automation as a whole. Attached a screenshot below of a workflow (matrix) job jummary, as per this issue request.

Workflow job summary with plan file artifact.

rdhar avatar Oct 29 '24 17:10 rdhar

It honestly feels weird, advertising your GHA in another actions repo. That feels inherently wrong, and actively makes me not want to switch.

joryirving avatar Oct 29 '24 20:10 joryirving

@rdhar I would also chime in here for a moment to give my 2 cents that what you're doing is not really constructive.

This is an issue opened in this repo to suggest/request a new feature for this project. Promoting your own project (even if it does answer the initial request) multiple times just pollutes this thread that had an entirely different purpose to begin with.

I understand you want to promote a project you worked on, but the issues section of similar projects might not be the most elegant way to go about it

mircea-pavel-anton avatar Oct 29 '24 20:10 mircea-pavel-anton

Hey @joryirving and @mircea-pavel-anton, thanks for sharing your thoughts. I get why it feels off to mention my project here, but I just wanted to share an alternative for the feature request since it's been open for nearly four months now.

Open-source thrives on communities which share ideas and explore different options, instead of limiting ourselves to just one solution. I appreciate your perspective as well, and hope you see where I'm coming from.

rdhar avatar Oct 29 '24 20:10 rdhar

To be honest, the Summary would be a "nice to have" but not a requirement. I really like how this GHA formats the comments https://github.com/borchero/terraform-plan-comment#example-comments

joryirving avatar Oct 30 '24 03:10 joryirving