Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/actions-ecosystem/action-create-comment
💬 GitHub Action to create a comment
https://github.com/actions-ecosystem/action-create-comment
actions comment github
Last synced: 12 days ago
JSON representation
💬 GitHub Action to create a comment
- Host: GitHub
- URL: https://github.com/actions-ecosystem/action-create-comment
- Owner: actions-ecosystem
- License: apache-2.0
- Created: 2020-05-03T08:22:39.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-23T09:01:36.000Z (almost 2 years ago)
- Last Synced: 2024-10-24T15:42:33.755Z (18 days ago)
- Topics: actions, comment, github
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/actions-ecosystem-create-comment
- Size: 974 KB
- Stars: 37
- Watchers: 2
- Forks: 8
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Action Create Comment
[![actions-workflow-test][actions-workflow-test-badge]][actions-workflow-test]
[![release][release-badge]][release]
[![license][license-badge]][license]![screenshot](./docs/assets/screenshot.png)
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
```yaml
name: Create Commenton: [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](./LICENSE).
[actions-workflow-test]: https://github.com/actions-ecosystem/action-create-comment/actions?query=workflow%3ATest
[actions-workflow-test-badge]: https://img.shields.io/github/workflow/status/actions-ecosystem/action-create-comment/Test?label=Test&style=for-the-badge&logo=github[release]: https://github.com/actions-ecosystem/action-create-comment/releases
[release-badge]: https://img.shields.io/github/v/release/actions-ecosystem/action-create-comment?style=for-the-badge&logo=github[license]: LICENSE
[license-badge]: