Skip to content

πŸ’¬ Create a new comment on a GitHub Issue

Notifications You must be signed in to change notification settings

actions4gh/create-issue-comment

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Create GitHub Issue comment

πŸ’¬ Create a new comment on a GitHub Issue

Try me!

πŸ‘¨β€πŸ’» Use the GitHub CLI
😱 You don't even need a GitHub Action to do it!

Usage

GitHub Actions GitHub

πŸš€ Here's what you're after:

name: Lorem Ipsum comment
on:
  issues:
    types: labeled
jobs:
  lorem-ipsum-comment:
    if: github.event.label.name == 'lorem ipsum'
    permissions:
      issues: write
    runs-on: ubuntu-latest
    steps:
      - run: gh issue comment "$NUMBER" --body "$BODY"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GH_REPO: ${{ github.repository }}
          NUMBER: ${{ github.event.issue.number }}
          BODY: >
            Lorem ipsum is placeholder text commonly used in the graphic, print,
            and publishing industries for previewing layouts and visual mockups.

πŸ’‘ The GitHub CLI is always provided on all GitHub runners. To install it on custom runners check out actions4gh/setup-gh.

gh issue comment {<number> | <url>} [flags]

gh issue comment options: (excerpt)

  • -b,Β --body <text>: The comment body text

  • -F,Β --body-file <file>: Read body text from file (use "-" to read from standard input)

  • --edit-last: Edit the last comment of the same author

  • -R,Β --repo <[HOST/]OWNER/REPO>: Select another repository using the [HOST/]OWNER/REPO format

πŸ“š gh issue comment | GitHub CLI