Commit 5705661
Fix issue bot triggering on PRs (#38525)
Summary:
This PR fixes a bug with an issue labeling bot issues triggering on comments to pull requests. The action doesn't trigger when a pull request is open (but other actions add comments immediately).
From [GitHub docs](https://docs.github.com/en/webhooks-and-events/events/issue-event-types):
> GitHub's REST API considers every pull request to be an issue, but not every issue is a pull request. [...] Pull requests have a **`pull_request` property in the `issue` object.**
☝️ Which is a way to differentiate between an issue and a pull request
Relates to a bug introduced in #38338 and links to ☂️#35591
## Changelog:
[INTERNAL] [FIXED] - Prevent issue bot triggering on pull requests
Pull Request resolved: #38525
Test Plan:
This PR makes use of `github.event.issue.pull_request` object which is null on issues and comments in issues:

and truthy on comments on pull requests

With a change from PR bot skips execution on comments on pull requests

Reviewed By: ryancat
Differential Revision: D47628330
Pulled By: cortinico
fbshipit-source-id: 63e7180bb57ffd34904414a702c02019e18a042b1 parent 216865c commit 5705661
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments