Skip to content
Latchkey

How to React to a Command Comment in GitHub Actions

A reaction on the command comment tells the author the bot saw the request, without adding another comment to the thread.

Use reactions.createForIssueComment to add a +1 or rocket reaction when a command starts, and a follow-up reaction or comment when it finishes.

Steps

  • Grant the job pull-requests: write (or issues: write).
  • Call reactions.createForIssueComment with the comment id.
  • Pick a content value such as eyes, +1, or rocket.

Reaction step

.github/workflows/ci.yml
permissions:
  issues: write
  pull-requests: write
jobs:
  ack:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/github-script@v7
        with:
          script: |
            await github.rest.reactions.createForIssueComment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              comment_id: context.payload.comment.id,
              content: 'rocket'
            })

Gotchas

  • Valid reaction contents are limited to +1, -1, laugh, confused, heart, hooray, rocket, eyes.
  • slash-command-dispatch can add the initial reaction for you with reaction-token.
  • Reactions are cheap feedback; post a comment for detailed results.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →