You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When contributors submit DNS configuration changes via pull requests from forks, GitHub Actions workflows that run on the pull_request run with a read-only GitHub.token and do not have access to secrets.
To run a test-and-comment workflow with write permission (to add a comment) and secrets access (to run octodns-sync), the workflow can run on the pull_request_target event. In this case, however, comment.sh exits early without adding a comment.
Expected Behavior
add_pr_comment should add a pull request comment, even if the head of the pull request is a fork.
Actual Behavior
Currently scripts/comment.sh exits early if GitHub.event_type is not pull_request:
Description
When contributors submit DNS configuration changes via pull requests from forks, GitHub Actions workflows that run on the
pull_request
run with a read-only GitHub.token and do not have access to secrets.To run a test-and-comment workflow with write permission (to add a comment) and secrets access (to run
octodns-sync
), the workflow can run on thepull_request_target
event. In this case, however, comment.sh exits early without adding a comment.Expected Behavior
add_pr_comment
should add a pull request comment, even if the head of the pull request is a fork.Actual Behavior
Currently scripts/comment.sh exits early if GitHub.event_type is not
pull_request
:octodns-sync/scripts/comment.sh
Lines 8 to 16 in 41a0287
Possible Fix
In #67 @travislikestocode proposed adding the
pull_request_target
event to the check in comment.sh, changing it from:to:
Steps to Reproduce
add_pr_comment
enabledpull_request_target
eventContext
See prior discussion in #41 and #67.
Your Environment
The text was updated successfully, but these errors were encountered: