|
| 1 | +# Create issue or comment |
| 2 | + |
| 3 | +<!-- These docs are generated by a tool --> |
| 4 | + |
| 5 | +A composite action for getting either creating a Github issue, or commenting on |
| 6 | +an existing one, based on the author and the provided label(s), assignees, etc. |
| 7 | +This requires `issues: write` permissions in order to work correctly. |
| 8 | + |
| 9 | +## Inputs |
| 10 | + |
| 11 | +| Name | Description | Default | |
| 12 | +|------|-------------|---------| |
| 13 | +| `title` (*) | The title to use for the issue | _N/A_ | |
| 14 | +| `assignees` | A list of assignees to add, separated by newlines. | `""` | |
| 15 | +| `body` | The body text of the github issue | `""` | |
| 16 | +| `comment` | The comment to leave if an issue already exists | `"${{ inputs.body }}"` | |
| 17 | +| `labels` | A list of labels to add, separated by newlines. | `""` | |
| 18 | +| `owner` | The repository owner | `""` | |
| 19 | +| `repo` | The repository | `""` | |
| 20 | +| `retries` | The number of times to try retrying | `"3"` | |
| 21 | +| `retry-exempt-status-codes` | The retry exempt status codes | `"400,401,403,404,422"` | |
| 22 | + |
| 23 | +**Note:** _(*) marks required inputs_ |
| 24 | + |
| 25 | +## Outputs |
| 26 | + |
| 27 | +| Name | Description | |
| 28 | +|------|-------------| |
| 29 | +| `created-issue` | A boolean indicating whether a new issue was created | |
| 30 | +| `issue-number` | The number of the created issue | |
| 31 | +| `issue-url` | The HTTP URL of the newly created issue | |
| 32 | + |
| 33 | +## Example |
| 34 | + |
| 35 | +Here is a very basic example of how to use the `issues/create-or-comment` composite action |
| 36 | +in a project (placeholders are used in place of real inputs): |
| 37 | + |
| 38 | +```yaml |
| 39 | +run: |
| 40 | + example-job: |
| 41 | + # ... |
| 42 | + steps: |
| 43 | + # ... |
| 44 | + - name: Create issue or comment |
| 45 | + id: create-issue-or-comment # only necessary if using this action's output(s) |
| 46 | + uses: bitwizeshift/actions-github/issues/create-or-comment@v1 |
| 47 | + with: |
| 48 | + # Required inputs |
| 49 | + title: TITLE |
| 50 | + |
| 51 | + # Optional inputs |
| 52 | + assignees: ASSIGNEES |
| 53 | + body: BODY |
| 54 | + comment: COMMENT |
| 55 | + labels: LABELS |
| 56 | + owner: OWNER |
| 57 | + repo: REPO |
| 58 | + retries: RETRIES |
| 59 | + retry-exempt-status-codes: RETRY_EXEMPT_STATUS_CODES |
| 60 | + # ... |
| 61 | + - name: Uses "Create issue or comment" Outputs |
| 62 | + uses: example-actions/use-create-issue-or-comment@v3 # illustrative |
| 63 | + with: |
| 64 | + use-created-issue: ${{ steps.create-issue-or-comment.outputs.created-issue }} |
| 65 | + use-issue-number: ${{ steps.create-issue-or-comment.outputs.issue-number }} |
| 66 | + use-issue-url: ${{ steps.create-issue-or-comment.outputs.issue-url }} |
| 67 | +``` |
0 commit comments