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

Do Not Try to Comment on Non-PR Builds (fixes #50) #53

Merged
merged 1 commit into from Oct 4, 2019

Conversation

@nathandines
Copy link
Contributor

commented Sep 11, 2019

In the event of a non-PR workflow, the actions would still attempt to
post output to the non-existent PR URL. This change checks to see if jq
parsed a "null" URL, and doesn't run curl if that is the case.

@hashicorp-cla

This comment has been minimized.

Copy link

commented Sep 11, 2019

CLA assistant check
All committers have signed the CLA.

@sudomateo

This comment has been minimized.

Copy link
Member

commented Sep 12, 2019

Thanks for the work on this! There's a new environment variable named GITHUB_EVENT_NAME which will be populated like so when the event is a pull request.

GITHUB_EVENT_NAME=pull_request

Best to wrap the entire attempt to post a comment around that variable instead.

@nathandines

This comment has been minimized.

Copy link
Contributor Author

commented Sep 12, 2019

Ah, excellent. Much nicer to be able to use that. I've just made the requested adjustments.

In the event of a non-PR workflow, the actions would still attempt to
post output to the non-existent PR URL. This change will prevent
comments from being published when running the action against a PR.
@nathandines

This comment has been minimized.

Copy link
Contributor Author

commented Oct 4, 2019

@sudomateo any chance I could get this merged, please?

@sudomateo sudomateo merged commit 70e3a08 into hashicorp:master Oct 4, 2019
1 check passed
1 check passed
license/cla Contributor License Agreement is signed.
Details
@sudomateo

This comment has been minimized.

Copy link
Member

commented Oct 4, 2019

Released in v0.4.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.