issue_comment

This page was generated based on Github’s Documentation. See our welcome page for context and details.

Github Event issue_comment #

Github Action Trigger #

source

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
issue_commentcreated
edited
deleted
Last commit on default branchDefault branch

Note: More than one activity type triggers this event. For information about each activity type, see “Webhook events and payloads.” By default, all activity types trigger workflows that run on this event. You can limit your workflow runs to specific activity types using the types keyword. For more information, see “Workflow syntax for GitHub Actions.”

Note: This event will only trigger a workflow run if the workflow file is on the default branch.

Runs your workflow when an issue or pull request comment is created, edited, or deleted. For information about the issue comment APIs, see “Objects” in the GraphQL API documentation or “Webhook events and payloads” in the REST API documentation.

For example, you can run a workflow when an issue or pull request comment has been created or deleted.

on:
  issue_comment:
    types: [created, deleted]

issue_comment on issues only or pull requests only #

The issue_comment event occurs for comments on both issues and pull requests. You can use the github.event.issue.pull_request property in a conditional to take different action depending on whether the triggering object was an issue or pull request.

For example, this workflow will run the pr_commented job only if the issue_comment event originated from a pull request. It will run the issue_commented job only if the issue_comment event originated from an issue.

on: issue_comment

jobs:
  pr_commented:
    # This job only runs for pull request comments
    name: PR comment
    if: ${{ github.event.issue.pull_request }}
    runs-on: ubuntu-latest
    steps:
      - run: |
          echo A comment on PR $NUMBER          
        env:
          NUMBER: ${{ github.event.issue.number }}

  issue_commented:
    # This job only runs for issue comments
    name: Issue comment
    if: ${{ !github.event.issue.pull_request }}
    runs-on: ubuntu-latest
    steps:
      - run: |
          echo A comment on issue $NUMBER          
        env:
          NUMBER: ${{ github.event.issue.number }}

Event Payload #

source

Activities: created, deleted, edited

Common Fields #

These fields are common to every event types available with this trigger.
fieldtyperequireddescription
github.event.commentobjectrequired

The comment itself.

github.event.comment.author_associationCOLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNERrequired

How the author is associated with the repository.

github.event.comment.bodystringrequired

Contents of the issue comment

github.event.comment.created_atstringrequired
github.event.comment.html_urlstringrequired
github.event.comment.idintegerrequired

Unique identifier of the issue comment

github.event.comment.issue_urlstringrequired
github.event.comment.node_idstringrequired
github.event.comment.performed_via_github_appobjectrequired

GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.

github.event.comment.performed_via_github_app.idintegerrequired

Unique identifier of the GitHub app

github.event.comment.performed_via_github_app.slugstringoptional

The slug name of the GitHub app

github.event.comment.performed_via_github_app.node_idstringrequired
github.event.comment.performed_via_github_app.ownerobjectrequired

A GitHub user.

github.event.comment.performed_via_github_app.owner.namestring or nulloptional
github.event.comment.performed_via_github_app.owner.emailstring or nulloptional
github.event.comment.performed_via_github_app.owner.loginstringrequired
github.event.comment.performed_via_github_app.owner.idintegerrequired
github.event.comment.performed_via_github_app.owner.node_idstringrequired
github.event.comment.performed_via_github_app.owner.avatar_urlstringrequired
github.event.comment.performed_via_github_app.owner.gravatar_idstring or nullrequired
github.event.comment.performed_via_github_app.owner.urlstringrequired
github.event.comment.performed_via_github_app.owner.html_urlstringrequired
github.event.comment.performed_via_github_app.owner.followers_urlstringrequired
github.event.comment.performed_via_github_app.owner.following_urlstringrequired
github.event.comment.performed_via_github_app.owner.gists_urlstringrequired
github.event.comment.performed_via_github_app.owner.starred_urlstringrequired
github.event.comment.performed_via_github_app.owner.subscriptions_urlstringrequired
github.event.comment.performed_via_github_app.owner.organizations_urlstringrequired
github.event.comment.performed_via_github_app.owner.repos_urlstringrequired
github.event.comment.performed_via_github_app.owner.events_urlstringrequired
github.event.comment.performed_via_github_app.owner.received_events_urlstringrequired
github.event.comment.performed_via_github_app.owner.typestringrequired
github.event.comment.performed_via_github_app.owner.site_adminbooleanrequired
github.event.comment.performed_via_github_app.owner.starred_atstringoptional
github.event.comment.performed_via_github_app.namestringrequired

The name of the GitHub app

github.event.comment.performed_via_github_app.descriptionstring or nullrequired
github.event.comment.performed_via_github_app.external_urlstringrequired
github.event.comment.performed_via_github_app.html_urlstringrequired
github.event.comment.performed_via_github_app.created_atstringrequired
github.event.comment.performed_via_github_app.updated_atstringrequired
github.event.comment.performed_via_github_app.permissionsobjectrequired

The set of permissions for the GitHub app

github.event.comment.performed_via_github_app.permissions.issuesstringoptional
github.event.comment.performed_via_github_app.permissions.checksstringoptional
github.event.comment.performed_via_github_app.permissions.metadatastringoptional
github.event.comment.performed_via_github_app.permissions.contentsstringoptional
github.event.comment.performed_via_github_app.permissions.deploymentsstringoptional
github.event.comment.performed_via_github_app.eventsarray of stringsrequired

The list of events for the GitHub app

github.event.comment.performed_via_github_app.installations_countintegeroptional

The number of installations associated with the GitHub app

github.event.comment.performed_via_github_app.client_idstringoptional
github.event.comment.performed_via_github_app.client_secretstringoptional
github.event.comment.performed_via_github_app.webhook_secretstring or nulloptional
github.event.comment.performed_via_github_app.pemstringoptional
github.event.comment.reactionsobjectrequired
github.event.comment.reactions.+1integerrequired
github.event.comment.reactions.-1integerrequired
github.event.comment.reactions.confusedintegerrequired
github.event.comment.reactions.eyesintegerrequired
github.event.comment.reactions.heartintegerrequired
github.event.comment.reactions.hoorayintegerrequired
github.event.comment.reactions.laughintegerrequired
github.event.comment.reactions.rocketintegerrequired
github.event.comment.reactions.total_countintegerrequired
github.event.comment.reactions.urlstringrequired
github.event.comment.updated_atstringrequired
github.event.comment.urlstringrequired

URL for the issue comment

github.event.comment.userobject or nullrequired
github.event.comment.user.avatar_urlstringoptional
github.event.comment.user.deletedbooleanoptional
github.event.comment.user.emailstring or nulloptional
github.event.comment.user.events_urlstringoptional
github.event.comment.user.followers_urlstringoptional
github.event.comment.user.following_urlstringoptional
github.event.comment.user.gists_urlstringoptional
github.event.comment.user.gravatar_idstringoptional
github.event.comment.user.html_urlstringoptional
github.event.comment.user.idintegerrequired
github.event.comment.user.loginstringrequired
github.event.comment.user.namestringoptional
github.event.comment.user.node_idstringoptional
github.event.comment.user.organizations_urlstringoptional
github.event.comment.user.received_events_urlstringoptional
github.event.comment.user.repos_urlstringoptional
github.event.comment.user.site_adminbooleanoptional
github.event.comment.user.starred_urlstringoptional
github.event.comment.user.subscriptions_urlstringoptional
github.event.comment.user.urlstringoptional
github.event.enterpriseobjectoptional

An enterprise on GitHub. Webhook payloads contain the enterprise property when the webhook is configured on an enterprise account or an organization that’s part of an enterprise account. For more information, see “About enterprise accounts."

github.event.installationobjectoptional

The GitHub App installation. Webhook payloads contain the installation property when the event is configured for and sent to a GitHub App. For more information, see “Using webhooks with GitHub Apps."

github.event.issueobjectrequired

The issue the comment belongs to.

github.event.issue.active_lock_reasonresolved, off-topic, too heated, spam, Nonerequired
github.event.issue.assigneeobject or nullrequired
github.event.issue.assignee.avatar_urlstringoptional
github.event.issue.assignee.deletedbooleanoptional
github.event.issue.assignee.emailstring or nulloptional
github.event.issue.assignee.events_urlstringoptional
github.event.issue.assignee.followers_urlstringoptional
github.event.issue.assignee.following_urlstringoptional
github.event.issue.assignee.gists_urlstringoptional
github.event.issue.assignee.gravatar_idstringoptional
github.event.issue.assignee.html_urlstringoptional
github.event.issue.assignee.idintegerrequired
github.event.issue.assignee.loginstringrequired
github.event.issue.assignee.namestringoptional
github.event.issue.assignee.node_idstringoptional
github.event.issue.assignee.organizations_urlstringoptional
github.event.issue.assignee.received_events_urlstringoptional
github.event.issue.assignee.repos_urlstringoptional
github.event.issue.assignee.site_adminbooleanoptional
github.event.issue.assignee.starred_urlstringoptional
github.event.issue.assignee.subscriptions_urlstringoptional
github.event.issue.assignee.typeBot, User, Organization, Mannequinoptional
github.event.issue.assignee.urlstringoptional
github.event.issue.assigneesarray of object,nullsrequired
github.event.issue.author_associationCOLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNERrequired

How the author is associated with the repository.

github.event.issue.bodystring or nullrequired

Contents of the issue

github.event.issue.closed_atstring or nullrequired
github.event.issue.commentsintegerrequired
github.event.issue.comments_urlstringrequired
github.event.issue.created_atstringrequired
github.event.issue.draftbooleanoptional
github.event.issue.events_urlstringrequired
github.event.issue.html_urlstringrequired
github.event.issue.idintegerrequired
github.event.issue.labelsarray of objectsrequired
github.event.issue.labels.colorstringrequired

6-character hex code, without the leading #, identifying the color

github.event.issue.labels.defaultbooleanrequired
github.event.issue.labels.descriptionstring or nullrequired
github.event.issue.labels.idintegerrequired
github.event.issue.labels.namestringrequired

The name of the label.

github.event.issue.labels.node_idstringrequired
github.event.issue.labels.urlstringrequired

URL for the label

github.event.issue.labels_urlstringrequired
github.event.issue.lockedbooleanrequired
github.event.issue.milestoneobject or nullrequired

A collection of related issues and pull requests.

github.event.issue.milestone.closed_atstring or nullrequired
github.event.issue.milestone.closed_issuesintegerrequired
github.event.issue.milestone.created_atstringrequired
github.event.issue.milestone.creatorobject or nullrequired
github.event.issue.milestone.creator.avatar_urlstringoptional
github.event.issue.milestone.creator.deletedbooleanoptional
github.event.issue.milestone.creator.emailstring or nulloptional
github.event.issue.milestone.creator.events_urlstringoptional
github.event.issue.milestone.creator.followers_urlstringoptional
github.event.issue.milestone.creator.following_urlstringoptional
github.event.issue.milestone.creator.gists_urlstringoptional
github.event.issue.milestone.creator.gravatar_idstringoptional
github.event.issue.milestone.creator.html_urlstringoptional
github.event.issue.milestone.creator.idintegerrequired
github.event.issue.milestone.creator.loginstringrequired
github.event.issue.milestone.creator.namestringoptional
github.event.issue.milestone.creator.node_idstringoptional
github.event.issue.milestone.creator.organizations_urlstringoptional
github.event.issue.milestone.creator.received_events_urlstringoptional
github.event.issue.milestone.creator.repos_urlstringoptional
github.event.issue.milestone.creator.site_adminbooleanoptional
github.event.issue.milestone.creator.starred_urlstringoptional
github.event.issue.milestone.creator.subscriptions_urlstringoptional
github.event.issue.milestone.creator.typeBot, User, Organization, Mannequinoptional
github.event.issue.milestone.creator.urlstringoptional
github.event.issue.milestone.descriptionstring or nullrequired
github.event.issue.milestone.due_onstring or nullrequired
github.event.issue.milestone.html_urlstringrequired
github.event.issue.milestone.idintegerrequired
github.event.issue.milestone.labels_urlstringrequired
github.event.issue.milestone.node_idstringrequired
github.event.issue.milestone.numberintegerrequired

The number of the milestone.

github.event.issue.milestone.open_issuesintegerrequired
github.event.issue.milestone.stateopen, closedrequired

The state of the milestone.

github.event.issue.milestone.titlestringrequired

The title of the milestone.

github.event.issue.milestone.updated_atstringrequired
github.event.issue.milestone.urlstringrequired
github.event.issue.node_idstringrequired
github.event.issue.numberintegerrequired
github.event.issue.performed_via_github_appobject or nulloptional
github.event.issue.pull_requestobjectoptional
github.event.issue.pull_request.diff_urlstringoptional
github.event.issue.pull_request.html_urlstringoptional
github.event.issue.pull_request.merged_atstring or nulloptional
github.event.issue.pull_request.patch_urlstringoptional
github.event.issue.pull_request.urlstringoptional
github.event.issue.reactionsobjectrequired
github.event.issue.reactions.+1integerrequired
github.event.issue.reactions.-1integerrequired
github.event.issue.reactions.confusedintegerrequired
github.event.issue.reactions.eyesintegerrequired
github.event.issue.reactions.heartintegerrequired
github.event.issue.reactions.hoorayintegerrequired
github.event.issue.reactions.laughintegerrequired
github.event.issue.reactions.rocketintegerrequired
github.event.issue.reactions.total_countintegerrequired
github.event.issue.reactions.urlstringrequired
github.event.issue.repository_urlstringrequired
github.event.issue.stateopen, closedrequired

State of the issue; either ‘open’ or ‘closed’

github.event.issue.state_reasonstring or nulloptional
github.event.issue.timeline_urlstringoptional
github.event.issue.titlestringrequired

Title of the issue

github.event.issue.updated_atstringrequired
github.event.issue.urlstringrequired

URL for the issue

github.event.issue.userobject or nullrequired
github.event.issue.user.avatar_urlstringoptional
github.event.issue.user.deletedbooleanoptional
github.event.issue.user.emailstring or nulloptional
github.event.issue.user.events_urlstringoptional
github.event.issue.user.followers_urlstringoptional
github.event.issue.user.following_urlstringoptional
github.event.issue.user.gists_urlstringoptional
github.event.issue.user.gravatar_idstringoptional
github.event.issue.user.html_urlstringoptional
github.event.issue.user.idintegerrequired
github.event.issue.user.loginstringrequired
github.event.issue.user.namestringoptional
github.event.issue.user.node_idstringoptional
github.event.issue.user.organizations_urlstringoptional
github.event.issue.user.received_events_urlstringoptional
github.event.issue.user.repos_urlstringoptional
github.event.issue.user.site_adminbooleanoptional
github.event.issue.user.starred_urlstringoptional
github.event.issue.user.subscriptions_urlstringoptional
github.event.issue.user.typeBot, User, Organization, Mannequinoptional
github.event.issue.user.urlstringoptional
github.event.organizationobjectoptional

A GitHub organization. Webhook payloads contain the organization property when the webhook is configured for an organization, or when the event occurs from activity in a repository owned by an organization.

github.event.repositoryobjectrequired

The repository on GitHub where the event occurred. Webhook payloads contain the repository property when the event occurs from activity in a repository.

github.event.senderobjectrequired

The GitHub user that triggered the event. This property is included in every webhook payload.

created #

This event occurs when there is activity relating to a comment on an issue or pull request. For more information about issues and pull requests, see "About issues" and "About pull requests." For information about the APIs to manage issue comments, see the GraphQL documentation or "Issue comments" in the REST API documentation.

For activity relating to an issue as opposed to comments on an issue, use the issue event. For activity related to pull request reviews or pull request review comments, use the pull_request_review or pull_request_review_comment events. For more information about the different types of pull request comments, see "Working with comments."

To subscribe to this event, a GitHub App must have at least read-level access for the "Issues" repository permission.

fieldtyperequireddescription
github.event.actioncreatedrequired
github.event.comment.user.typeBot, User, Organizationoptional

deleted #

This event occurs when there is activity relating to a comment on an issue or pull request. For more information about issues and pull requests, see "About issues" and "About pull requests." For information about the APIs to manage issue comments, see the GraphQL documentation or "Issue comments" in the REST API documentation.

For activity relating to an issue as opposed to comments on an issue, use the issue event. For activity related to pull request reviews or pull request review comments, use the pull_request_review or pull_request_review_comment events. For more information about the different types of pull request comments, see "Working with comments."

To subscribe to this event, a GitHub App must have at least read-level access for the "Issues" repository permission.

fieldtyperequireddescription
github.event.actiondeletedrequired
github.event.comment.user.typeBot, User, Organization, Mannequinoptional

edited #

This event occurs when there is activity relating to a comment on an issue or pull request. For more information about issues and pull requests, see "About issues" and "About pull requests." For information about the APIs to manage issue comments, see the GraphQL documentation or "Issue comments" in the REST API documentation.

For activity relating to an issue as opposed to comments on an issue, use the issue event. For activity related to pull request reviews or pull request review comments, use the pull_request_review or pull_request_review_comment events. For more information about the different types of pull request comments, see "Working with comments."

To subscribe to this event, a GitHub App must have at least read-level access for the "Issues" repository permission.

fieldtyperequireddescription
github.event.actioneditedrequired
github.event.changesobjectrequired

The changes to the comment.

github.event.changes.bodyobjectoptional
github.event.changes.body.fromstringrequired

The previous version of the body.

github.event.comment.user.typeBot, User, Organization, Mannequinoptional