A composite action that creates a comment on Github.
Requires the issues: write
permission to work.
Name | Description | Default |
---|---|---|
body (*) |
The message to comment | N/A |
github-token |
The default token to use for this Git operation. If unspecified, this will default to github.token . |
"${{ github.token }}" |
issue-number |
The issue number to comment on | "0" |
owner |
The repository owner. If unspecified, this will default to the owner of the current repository. | "" |
repo |
The name of the repository. If unspecified, this will default to the current repository. | "" |
retries |
The number of times to attempt to retry if this fails. | "0" |
retry-exempt-status-codes |
A list of error-codes that are exempt from being retried. | "400,401,403,404,422" |
Note: (*) marks required inputs
Name | Description |
---|---|
comment-api-url |
An API URL to the created comment |
comment-id |
The ID of the created comment |
comment-url |
A browser URL to the created comment |
Here is a very basic example of how to use the issues/create-comment
composite action
in a project (placeholders are used in place of real inputs):
run:
example-job:
# ...
steps:
# ...
- name: Create comment on Issue
id: issues-create-comment # only necessary if using this action's output(s)
uses: bitwizeshift/actions-github/issues/create-comment@v1
with:
# Required inputs
body: BODY
# Optional inputs
github-token: GITHUB_TOKEN
issue-number: ISSUE_NUMBER
owner: OWNER
repo: REPO
retries: RETRIES
retry-exempt-status-codes: RETRY_EXEMPT_STATUS_CODES
# ...
- name: Uses "Create comment on Issue" Outputs
uses: example-actions/use-issues-create-comment@v3 # illustrative
with:
use-comment-api-url: ${{ steps.issues-create-comment.outputs.comment-api-url }}
use-comment-id: ${{ steps.issues-create-comment.outputs.comment-id }}
use-comment-url: ${{ steps.issues-create-comment.outputs.comment-url }}