A composite action for getting either creating a Github issue, or commenting on
an existing one, based on the author and the provided label(s), assignees, etc.
This requires issues: write permissions in order to work correctly.
| Name | Description | Default |
|---|---|---|
title (*) |
The title to use for the issue | N/A |
assignees |
A list of assignees to add, separated by newlines. | "" |
body |
The body text of the github issue | "" |
comment |
The comment to leave if an issue already exists | "${{ inputs.body }}" |
github-token |
The default token to use for this Git operation. If unspecified, this will default to github.token. |
"${{ github.token }}" |
labels |
A list of labels to add, separated by newlines. | "" |
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 |
|---|---|
created-issue |
A boolean indicating whether a new issue was created |
issue-number |
The number of the created issue |
issue-url |
The HTTP URL of the newly created issue |
Here is a very basic example of how to use the issues/create-or-comment composite action
in a project (placeholders are used in place of real inputs):
run:
example-job:
# ...
steps:
# ...
- name: Create issue or comment
id: issues-create-or-comment # only necessary if using this action's output(s)
uses: bitwizeshift/actions-github/issues/create-or-comment@v1
with:
# Required inputs
title: TITLE
# Optional inputs
assignees: ASSIGNEES
body: BODY
comment: COMMENT
github-token: GITHUB_TOKEN
labels: LABELS
owner: OWNER
repo: REPO
retries: RETRIES
retry-exempt-status-codes: RETRY_EXEMPT_STATUS_CODES
# ...
- name: Uses "Create issue or comment" Outputs
uses: example-actions/use-issues-create-or-comment@v3 # illustrative
with:
use-created-issue: ${{ steps.issues-create-or-comment.outputs.created-issue }}
use-issue-number: ${{ steps.issues-create-or-comment.outputs.issue-number }}
use-issue-url: ${{ steps.issues-create-or-comment.outputs.issue-url }}