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

Use github.event.pull_request.comments_url #97

Merged
merged 2 commits into from
Feb 13, 2023
Merged

Use github.event.pull_request.comments_url #97

merged 2 commits into from
Feb 13, 2023

Conversation

jasperroel
Copy link
Contributor

Description

Not sure when this change happened, but in order to get the correct comments_url from GitHub, the proper environment name is github.event.pull_request.comments_url (note the extra .event).

Motivation and Context

This bugfix ensures that for a pull_request target, a comment is added again if add_pr_comment is set to Yet and pr_comment_token is set.

Without this fix the Action log wil mention something like this:

INFO: $ADD_PR_COMMENT is 'Yes' and $PR_COMMENT_TOKEN is set.
SKIP: $COMMENTS_URL is not set.
Was this workflow run triggered from a pull request?

With this fix, the expected result of a PR comment is achieved:

INFO: $ADD_PR_COMMENT is 'Yes' and $PR_COMMENT_TOKEN is set.
<Response [201]>

How Has This Been Tested?

I've tested this locally, and you can also test it by using uses: jasperroel/octodns-sync@main instead of uses: solvaholic/octodns-sync@main

Copy link
Owner

@solvaholic solvaholic left a comment

Choose a reason for hiding this comment

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

Thank you for catching this and fixing it, @jasperroel 🙇

@solvaholic solvaholic merged commit 9cfbedd into solvaholic:main Feb 13, 2023
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.

2 participants