This page was generated based on Github’s Documentation. See our welcome page for context and details.
Github Event issue_comment
#
Github Action Trigger #
Webhook event payload | Activity types | GITHUB_SHA | GITHUB_REF |
---|---|---|---|
issue_comment | - created - edited - deleted | Last commit on default branch | Default 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 #
Activities: created
, deleted
, edited
Common Fields #
These fields are common to every event types available with this trigger.
field | type | required | description |
---|---|---|---|
github.event.comment | object | required | The comment itself. |
github.event.comment.author_association | COLLABORATOR , CONTRIBUTOR , FIRST_TIMER , FIRST_TIME_CONTRIBUTOR , MANNEQUIN , MEMBER , NONE , OWNER | required | How the author is associated with the repository. |
github.event.comment.body | string | required | Contents of the issue comment |
github.event.comment.created_at | string | required | |
github.event.comment.html_url | string | required | |
github.event.comment.id | integer | required | Unique identifier of the issue comment |
github.event.comment.issue_url | string | required | |
github.event.comment.node_id | string | required | |
github.event.comment.performed_via_github_app | object | required | 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.id | integer | required | Unique identifier of the GitHub app |
github.event.comment.performed_via_github_app.slug | string | optional | The slug name of the GitHub app |
github.event.comment.performed_via_github_app.node_id | string | required | |
github.event.comment.performed_via_github_app.owner | object | required | A GitHub user. |
github.event.comment.performed_via_github_app.owner.name | string or null | optional | |
github.event.comment.performed_via_github_app.owner.email | string or null | optional | |
github.event.comment.performed_via_github_app.owner.login | string | required | |
github.event.comment.performed_via_github_app.owner.id | integer | required | |
github.event.comment.performed_via_github_app.owner.node_id | string | required | |
github.event.comment.performed_via_github_app.owner.avatar_url | string | required | |
github.event.comment.performed_via_github_app.owner.gravatar_id | string or null | required | |
github.event.comment.performed_via_github_app.owner.url | string | required | |
github.event.comment.performed_via_github_app.owner.html_url | string | required | |
github.event.comment.performed_via_github_app.owner.followers_url | string | required | |
github.event.comment.performed_via_github_app.owner.following_url | string | required | |
github.event.comment.performed_via_github_app.owner.gists_url | string | required | |
github.event.comment.performed_via_github_app.owner.starred_url | string | required | |
github.event.comment.performed_via_github_app.owner.subscriptions_url | string | required | |
github.event.comment.performed_via_github_app.owner.organizations_url | string | required | |
github.event.comment.performed_via_github_app.owner.repos_url | string | required | |
github.event.comment.performed_via_github_app.owner.events_url | string | required | |
github.event.comment.performed_via_github_app.owner.received_events_url | string | required | |
github.event.comment.performed_via_github_app.owner.type | string | required | |
github.event.comment.performed_via_github_app.owner.site_admin | boolean | required | |
github.event.comment.performed_via_github_app.owner.starred_at | string | optional | |
github.event.comment.performed_via_github_app.name | string | required | The name of the GitHub app |
github.event.comment.performed_via_github_app.description | string or null | required | |
github.event.comment.performed_via_github_app.external_url | string | required | |
github.event.comment.performed_via_github_app.html_url | string | required | |
github.event.comment.performed_via_github_app.created_at | string | required | |
github.event.comment.performed_via_github_app.updated_at | string | required | |
github.event.comment.performed_via_github_app.permissions | object | required | The set of permissions for the GitHub app |
github.event.comment.performed_via_github_app.permissions.issues | string | optional | |
github.event.comment.performed_via_github_app.permissions.checks | string | optional | |
github.event.comment.performed_via_github_app.permissions.metadata | string | optional | |
github.event.comment.performed_via_github_app.permissions.contents | string | optional | |
github.event.comment.performed_via_github_app.permissions.deployments | string | optional | |
github.event.comment.performed_via_github_app.events | array of strings | required | The list of events for the GitHub app |
github.event.comment.performed_via_github_app.installations_count | integer | optional | The number of installations associated with the GitHub app |
github.event.comment.performed_via_github_app.client_id | string | optional | |
github.event.comment.performed_via_github_app.client_secret | string | optional | |
github.event.comment.performed_via_github_app.webhook_secret | string or null | optional | |
github.event.comment.performed_via_github_app.pem | string | optional | |
github.event.comment.reactions | object | required | |
github.event.comment.reactions.+1 | integer | required | |
github.event.comment.reactions.-1 | integer | required | |
github.event.comment.reactions.confused | integer | required | |
github.event.comment.reactions.eyes | integer | required | |
github.event.comment.reactions.heart | integer | required | |
github.event.comment.reactions.hooray | integer | required | |
github.event.comment.reactions.laugh | integer | required | |
github.event.comment.reactions.rocket | integer | required | |
github.event.comment.reactions.total_count | integer | required | |
github.event.comment.reactions.url | string | required | |
github.event.comment.updated_at | string | required | |
github.event.comment.url | string | required | URL for the issue comment |
github.event.comment.user | object or null | required | |
github.event.comment.user.avatar_url | string | optional | |
github.event.comment.user.deleted | boolean | optional | |
github.event.comment.user.email | string or null | optional | |
github.event.comment.user.events_url | string | optional | |
github.event.comment.user.followers_url | string | optional | |
github.event.comment.user.following_url | string | optional | |
github.event.comment.user.gists_url | string | optional | |
github.event.comment.user.gravatar_id | string | optional | |
github.event.comment.user.html_url | string | optional | |
github.event.comment.user.id | integer | required | |
github.event.comment.user.login | string | required | |
github.event.comment.user.name | string | optional | |
github.event.comment.user.node_id | string | optional | |
github.event.comment.user.organizations_url | string | optional | |
github.event.comment.user.received_events_url | string | optional | |
github.event.comment.user.repos_url | string | optional | |
github.event.comment.user.site_admin | boolean | optional | |
github.event.comment.user.starred_url | string | optional | |
github.event.comment.user.subscriptions_url | string | optional | |
github.event.comment.user.url | string | optional | |
github.event.enterprise | object | optional | An enterprise on GitHub. Webhook payloads contain the |
github.event.installation | object | optional | The GitHub App installation. Webhook payloads contain the |
github.event.issue | object | required | The issue the comment belongs to. |
github.event.issue.active_lock_reason | resolved , off-topic , too heated , spam , None | required | |
github.event.issue.assignee | object or null | required | |
github.event.issue.assignee.avatar_url | string | optional | |
github.event.issue.assignee.deleted | boolean | optional | |
github.event.issue.assignee.email | string or null | optional | |
github.event.issue.assignee.events_url | string | optional | |
github.event.issue.assignee.followers_url | string | optional | |
github.event.issue.assignee.following_url | string | optional | |
github.event.issue.assignee.gists_url | string | optional | |
github.event.issue.assignee.gravatar_id | string | optional | |
github.event.issue.assignee.html_url | string | optional | |
github.event.issue.assignee.id | integer | required | |
github.event.issue.assignee.login | string | required | |
github.event.issue.assignee.name | string | optional | |
github.event.issue.assignee.node_id | string | optional | |
github.event.issue.assignee.organizations_url | string | optional | |
github.event.issue.assignee.received_events_url | string | optional | |
github.event.issue.assignee.repos_url | string | optional | |
github.event.issue.assignee.site_admin | boolean | optional | |
github.event.issue.assignee.starred_url | string | optional | |
github.event.issue.assignee.subscriptions_url | string | optional | |
github.event.issue.assignee.type | Bot , User , Organization , Mannequin | optional | |
github.event.issue.assignee.url | string | optional | |
github.event.issue.assignees | array of object,nulls | required | |
github.event.issue.author_association | COLLABORATOR , CONTRIBUTOR , FIRST_TIMER , FIRST_TIME_CONTRIBUTOR , MANNEQUIN , MEMBER , NONE , OWNER | required | How the author is associated with the repository. |
github.event.issue.body | string or null | required | Contents of the issue |
github.event.issue.closed_at | string or null | required | |
github.event.issue.comments | integer | required | |
github.event.issue.comments_url | string | required | |
github.event.issue.created_at | string | required | |
github.event.issue.draft | boolean | optional | |
github.event.issue.events_url | string | required | |
github.event.issue.html_url | string | required | |
github.event.issue.id | integer | required | |
github.event.issue.labels | array of objects | required | |
github.event.issue.labels.color | string | required | 6-character hex code, without the leading #, identifying the color |
github.event.issue.labels.default | boolean | required | |
github.event.issue.labels.description | string or null | required | |
github.event.issue.labels.id | integer | required | |
github.event.issue.labels.name | string | required | The name of the label. |
github.event.issue.labels.node_id | string | required | |
github.event.issue.labels.url | string | required | URL for the label |
github.event.issue.labels_url | string | required | |
github.event.issue.locked | boolean | required | |
github.event.issue.milestone | object or null | required | A collection of related issues and pull requests. |
github.event.issue.milestone.closed_at | string or null | required | |
github.event.issue.milestone.closed_issues | integer | required | |
github.event.issue.milestone.created_at | string | required | |
github.event.issue.milestone.creator | object or null | required | |
github.event.issue.milestone.creator.avatar_url | string | optional | |
github.event.issue.milestone.creator.deleted | boolean | optional | |
github.event.issue.milestone.creator.email | string or null | optional | |
github.event.issue.milestone.creator.events_url | string | optional | |
github.event.issue.milestone.creator.followers_url | string | optional | |
github.event.issue.milestone.creator.following_url | string | optional | |
github.event.issue.milestone.creator.gists_url | string | optional | |
github.event.issue.milestone.creator.gravatar_id | string | optional | |
github.event.issue.milestone.creator.html_url | string | optional | |
github.event.issue.milestone.creator.id | integer | required | |
github.event.issue.milestone.creator.login | string | required | |
github.event.issue.milestone.creator.name | string | optional | |
github.event.issue.milestone.creator.node_id | string | optional | |
github.event.issue.milestone.creator.organizations_url | string | optional | |
github.event.issue.milestone.creator.received_events_url | string | optional | |
github.event.issue.milestone.creator.repos_url | string | optional | |
github.event.issue.milestone.creator.site_admin | boolean | optional | |
github.event.issue.milestone.creator.starred_url | string | optional | |
github.event.issue.milestone.creator.subscriptions_url | string | optional | |
github.event.issue.milestone.creator.type | Bot , User , Organization , Mannequin | optional | |
github.event.issue.milestone.creator.url | string | optional | |
github.event.issue.milestone.description | string or null | required | |
github.event.issue.milestone.due_on | string or null | required | |
github.event.issue.milestone.html_url | string | required | |
github.event.issue.milestone.id | integer | required | |
github.event.issue.milestone.labels_url | string | required | |
github.event.issue.milestone.node_id | string | required | |
github.event.issue.milestone.number | integer | required | The number of the milestone. |
github.event.issue.milestone.open_issues | integer | required | |
github.event.issue.milestone.state | open , closed | required | The state of the milestone. |
github.event.issue.milestone.title | string | required | The title of the milestone. |
github.event.issue.milestone.updated_at | string | required | |
github.event.issue.milestone.url | string | required | |
github.event.issue.node_id | string | required | |
github.event.issue.number | integer | required | |
github.event.issue.performed_via_github_app | object or null | optional | |
github.event.issue.pull_request | object | optional | |
github.event.issue.pull_request.diff_url | string | optional | |
github.event.issue.pull_request.html_url | string | optional | |
github.event.issue.pull_request.merged_at | string or null | optional | |
github.event.issue.pull_request.patch_url | string | optional | |
github.event.issue.pull_request.url | string | optional | |
github.event.issue.reactions | object | required | |
github.event.issue.reactions.+1 | integer | required | |
github.event.issue.reactions.-1 | integer | required | |
github.event.issue.reactions.confused | integer | required | |
github.event.issue.reactions.eyes | integer | required | |
github.event.issue.reactions.heart | integer | required | |
github.event.issue.reactions.hooray | integer | required | |
github.event.issue.reactions.laugh | integer | required | |
github.event.issue.reactions.rocket | integer | required | |
github.event.issue.reactions.total_count | integer | required | |
github.event.issue.reactions.url | string | required | |
github.event.issue.repository_url | string | required | |
github.event.issue.state | open , closed | required | State of the issue; either ‘open’ or ‘closed’ |
github.event.issue.state_reason | string or null | optional | |
github.event.issue.timeline_url | string | optional | |
github.event.issue.title | string | required | Title of the issue |
github.event.issue.updated_at | string | required | |
github.event.issue.url | string | required | URL for the issue |
github.event.issue.user | object or null | required | |
github.event.issue.user.avatar_url | string | optional | |
github.event.issue.user.deleted | boolean | optional | |
github.event.issue.user.email | string or null | optional | |
github.event.issue.user.events_url | string | optional | |
github.event.issue.user.followers_url | string | optional | |
github.event.issue.user.following_url | string | optional | |
github.event.issue.user.gists_url | string | optional | |
github.event.issue.user.gravatar_id | string | optional | |
github.event.issue.user.html_url | string | optional | |
github.event.issue.user.id | integer | required | |
github.event.issue.user.login | string | required | |
github.event.issue.user.name | string | optional | |
github.event.issue.user.node_id | string | optional | |
github.event.issue.user.organizations_url | string | optional | |
github.event.issue.user.received_events_url | string | optional | |
github.event.issue.user.repos_url | string | optional | |
github.event.issue.user.site_admin | boolean | optional | |
github.event.issue.user.starred_url | string | optional | |
github.event.issue.user.subscriptions_url | string | optional | |
github.event.issue.user.type | Bot , User , Organization , Mannequin | optional | |
github.event.issue.user.url | string | optional | |
github.event.organization | object | optional | A GitHub organization. Webhook payloads contain the |
github.event.repository | object | required | The repository on GitHub where the event occurred. Webhook payloads contain the |
github.event.sender | object | required | 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.
field | type | required | description |
---|---|---|---|
github.event.action | created | required | |
github.event.comment.user.type | Bot , User , Organization | optional |
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.
field | type | required | description |
---|---|---|---|
github.event.action | deleted | required | |
github.event.comment.user.type | Bot , User , Organization , Mannequin | optional |
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.
field | type | required | description |
---|---|---|---|
github.event.action | edited | required | |
github.event.changes | object | required | The changes to the comment. |
github.event.changes.body | object | optional | |
github.event.changes.body.from | string | required | The previous version of the body. |
github.event.comment.user.type | Bot , User , Organization , Mannequin | optional |