solvaholic / octodns-sync

GitHub Action to test and deploy DNS settings with OctoDNS
MIT License
28 stars 14 forks source link

Use `github.event.pull_request.comments_url` #97

Closed jasperroel closed 1 year ago

jasperroel commented 1 year ago

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