Skip to content

Actions Ecosystem Create Comment

Actions
Create a comment to an issue or a pull request
v1.0.0
Latest
Star (38)

Tags

 (2)

Action Create Comment

actions-workflow-test release license

screenshot

This is a GitHub Action to create a comment to an issue or a pull request.

This action extract the number from an issue or a pull request which has triggered this by default. It means you don't need to care about something annoying like whether you should use ${{ github.event.issue.number }} or ${{ github.event.pull_request.number }}.

It would be more useful to use this with other GitHub Actions' outputs.

Inputs

NAME DESCRIPTION TYPE REQUIRED DEFAULT
github_token A GitHub token. string true N/A
body The comment body. string true N/A
repo The owner and repository name. e.g.) Codertocat/Hello-World string false ${{ github.repository }}
number The number of the issue or pull request. number false ${{ github.event.issue.number }} or ${{ github.event.pull_request.number }}

Example

name: Create Comment

on: [issue_comment]

jobs:
  create_comment:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-ecosystem/action-create-comment@v1
        if: ${{ startsWith(github.event.comment.body, '/hello') }}
        with:
          github_token: ${{ secrets.github_token }}
          body: |
            Hello, @${{ github.actor }}!

License

Copyright 2020 The Actions Ecosystem Authors.

Action Create Comment is released under the Apache License 2.0.

Actions Ecosystem Create Comment is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Create a comment to an issue or a pull request
v1.0.0
Latest

Tags

 (2)

Actions Ecosystem Create Comment is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.