Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tomoasleep
Copy link
Contributor

@tomoasleep tomoasleep commented Jun 24, 2021

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.

@tomoasleep tomoasleep force-pushed the tomoasleep/parse-github-actions-event-context branch from 0b12943 to d0c5d88 Compare June 24, 2021 10:06
@tomoasleep tomoasleep changed the title Allow tfnotify executed by GitHub Actions to add pull request comments Enable tfnotify executed by GitHub Actions to add pull request comments Aug 19, 2021
@katainaka0503
Copy link

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

What is the status of this PR?

@katainaka0503
Copy link

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

@tomoasleep
Copy link
Contributor Author

@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
Copy link
Contributor

KeisukeYamashita commented Apr 7, 2022

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 👉 #77

Copy link
Contributor

@KeisukeYamashita KeisukeYamashita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I checked, I guess it can be handled by this PR 👉 #77 I have merged that PR.

That PR is much more simple as it only checks one env var GITHUB_REF and does not read any files from runtime. It will make better portability as it's runnable anywhere if it has GITHUB_REF on the other hand, this PR's implementation needs a file (JSON) for the event information.

Still, this PR implementation also supports triggers such as GitHub Issues, but as the title of this PR suggests, it often targets Pull Requests, and we believe such cases are limited.

Is it possible to try the latest tfnotify, please?

Please let us know if you have any concerns or questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants