Reaction Comments is a GitHub Action that deletes reaction comments, such as +1, and encourages the use of GitHub reactions.
The continued development of Reaction Comments is made possible thanks to the support of awesome backers. If you'd like to join them, please consider contributing with Patreon, PayPal or Bitcoin.
The action detects if new or edited comments consist solely of emojis
and shortcodes used in GitHub reactions. Matching comments are replaced with
the message set in issue-comment
or pr-comment
, and deleted after a day.
When the issue-comment
or pr-comment
parameter is set to ''
,
matching comments are immediately deleted.
Create the reaction-comments.yml
workflow file in the .github/workflows
directory, use one of the example workflows to get started.
The action can be configured using input parameters.
github-token
- GitHub access token, value must be
${{ github.token }}
or an encrypted secret that contains a personal access token - Optional, defaults to
${{ github.token }}
- GitHub access token, value must be
exempt-issue-labels
- Do not process comments on issues with any of these labels, value must be a comma separated list of labels
- Optional, defaults to
''
issue-comment
- Replace reaction comments on issues with this message,
{comment-author}
is an optional placeholder - Optional, defaults to
:wave: @{comment-author}, would you like to leave a reaction instead?
- Replace reaction comments on issues with this message,
exempt-pr-labels
- Do not process comments on pull requests with any of these labels, value must be a comma separated list of labels
- Optional, defaults to
''
pr-comment
- Replace reaction comments on pull requests with this message,
{comment-author}
is an optional placeholder - Optional, defaults to
:wave: @{comment-author}, would you like to leave a reaction instead?
- Replace reaction comments on pull requests with this message,
process-only
- Process comments only on issues or pull requests, value must be
either
issues
orprs
- Optional, defaults to
''
- Process comments only on issues or pull requests, value must be
either
log-output
- Log output parameters, value must be either
true
orfalse
- Optional, defaults to
false
- Log output parameters, value must be either
comments
- Comments that have been either deleted or scheduled for removal,
value is a JSON string in the form of
[{"owner": "actions", "repo": "toolkit", "issue_number": 1, "comment_id": 754701878, "is_review_comment": false, "status": "deleted"}]
, value ofstatus
is eitherscheduled
ordeleted
- Defaults to
''
- Comments that have been either deleted or scheduled for removal,
value is a JSON string in the form of
The following workflow will replace new or edited reaction comments with a helpful message, and delete them after a day.
name: 'Reaction Comments'
on:
issue_comment:
types: [created, edited]
pull_request_review_comment:
types: [created, edited]
schedule:
- cron: '0 0 * * *'
permissions:
actions: write
issues: write
pull-requests: write
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/reaction-comments@v4
This workflow declares all the available input parameters of the action and their default values. Any of the parameters can be omitted.
name: 'Reaction Comments'
on:
issue_comment:
types: [created, edited]
pull_request_review_comment:
types: [created, edited]
schedule:
- cron: '0 0 * * *'
permissions:
actions: write
issues: write
pull-requests: write
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/reaction-comments@v4
with:
github-token: ${{ github.token }}
exempt-issue-labels: ''
issue-comment: >
:wave: @{comment-author}, would you like to leave
a reaction instead?
exempt-pr-labels: ''
pr-comment: >
:wave: @{comment-author}, would you like to leave
a reaction instead?
process-only: ''
log-output: false
This step will process comments only on issues, and ignore threads
with the the help
or party-parrot
labels applied.
steps:
- uses: dessant/reaction-comments@v4
with:
exempt-issue-labels: 'help, party-parrot'
process-only: 'issues'
This step will process comments only on pull requests, and ignore threads
with the pinned
label applied.
steps:
- uses: dessant/reaction-comments@v4
with:
exempt-pr-labels: 'pinned'
process-only: 'prs'
By default, reaction comments are replaced with a message and deleted after a day. This step will immediately delete new or edited reaction comments on issues and pull requests.
steps:
- uses: dessant/reaction-comments@v4
with:
issue-comment: ''
pr-comment: ''
The action uses an installation access token by default to interact with GitHub.
You may also authenticate with a personal access token to perform actions
as a GitHub user instead of the github-actions
app.
Create a personal access token
with the repo
or public_repo
scopes enabled, and add the token as an
encrypted secret
for the repository or organization, then provide the action with the secret
using the github-token
input parameter.
steps:
- uses: dessant/reaction-comments@v4
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
Copyright (c) 2018-2023 Armin Sebastian
This software is released under the terms of the MIT License. See the LICENSE file for further information.