This event occurs when there is a comment on an issue. Github considers issues and pull_requests to both be issues to some degree, but we have separated these events for clarity.

@on("github.issue_comment")
def automation(input):
    pass

The following is an example payload which is passed in as an argument to your automation’s entrypoint:

{
  "$raw": {},
  "action": "created",
  "issue": {
    "author": "octocat",
    "body": "When trying to login with GitHub, the callback URL is not handling special characters correctly.",
    "comments": [
      {
        "author": "other-user",
        "body": "I can reproduce this issue. It happens when the username contains '@' symbol.",
        "created_at": "2024-03-21T14:35:00Z",
        "id": 987654321,
        "node_id": "MDEyOklzc3VlQ29tbWVudDk4NzY1NDMyMQ==",
        "url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/987654321"
      }
    ],
    "created_at": "2024-03-21T14:30:00Z",
    "id": 1234567890,
    "labels": [
      {
        "color": "d73a4a",
        "default": true,
        "description": "Something isn't working",
        "id": 123456,
        "name": "bug",
        "node_id": "MDU6TGFiZWwxMjM0NTY="
      },
      {
        "color": "b60205",
        "default": false,
        "description": "Needs immediate attention",
        "id": 789012,
        "name": "high-priority",
        "node_id": "MDU6TGFiZWw3ODkwMTI="
      }
    ],
    "node_id": "MDU6SXNzdWUxMjM0NTY3ODkw",
    "number": 42,
    "state": "open",
    "title": "Found a bug in the authentication flow",
    "url": "https://api.github.com/repos/octocat/Hello-World/issues/42"
  },
  "new_comment": {
    "author": "developer123",
    "body": "I've identified the root cause. The URL encoding is being applied twice in the callback handler. Will submit a fix shortly.",
    "created_at": "2024-03-21T15:00:00Z",
    "id": 987654322,
    "node_id": "MDEyOklzc3VlQ29tbWVudDk4NzY1NDMyMg==",
    "url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/987654322"
  },
  "owner": "octocat",
  "repo": "Hello-World"
}

Fields

$raw
object

The raw Github issue_comment event payload.

action
string

The action that occurred on the pull request.

issue
object

The issue that the comment is on.

new_comment
object

The new comment that was added.

owner
string

The owner of the repository.

repo
string

The name of the repository.