mercari / tfnotify

A CLI command to parse Terraform execution result and notify it to GitHub
MIT License
619 stars 91 forks source link

Enable tfnotify executed by GitHub Actions to add pull request comments #94

Open tomoasleep opened 3 years ago

tomoasleep commented 3 years ago

WHAT

This PR allows tfnotify executed by GitHub Actions on pull requests to add pull request comments instead of commit comments.

For GitHub Actions, the content of the event that triggered the action is stored as a JSON file at GITHUB_EVENT_PATH. For the pull_request events, we can read the number of the pull request from the file.

For more details about GITHUB_EVENT_PATH and the content of the event payload, please refer to these guides.

As an example of implementation, an official helper for GitHub Actions reads a pull request number or an issue number from the file.

WHY

This change allows users of tfnotify and GitHub Actons to comment results of plan or apply command to pull requests.

katainaka0503 commented 2 years ago

@b4b4r07 @dtan4 This feature would be very useful for GitHub Actions users.

What is the status of this PR?

katainaka0503 commented 2 years ago

@drlau @micnncim @KeisukeYamashita @tyuhara Hi! What's the status of this PR?

tomoasleep commented 2 years ago

@drlau @micnncim @KeisukeYamashita

Hi, can you review this PR? Do you want me to do anything about this PR? This code works in our company for a half year, but if you want to test this in a public environment, I'll help this :)

KeisukeYamashita commented 2 years ago

Sorry for the late reply (the author left the company and there are no clear maintainer for this project...)🙏 I will review this 2022/04/08 and also check if this conflicts with this PR 👉 https://github.com/mercari/tfnotify/pull/77