GitHub Action to find and output the number of last updated issue that has given labels and state.
Name | Description | Default |
---|---|---|
* labels |
Comma or newline-separated list of labels that the issue must have | |
state |
Issue state to filter by. Can be one of the following strings:
|
"open" |
Name | Description |
---|---|
issue_number |
The number of the issue found, if any. |
has_found |
Response status. Will be true if some issue was found. false otherwise. |
is_closed |
Will be true if the found issue is closed. The you can use issue_number to open it again with another GitHub Action. |
Note that none of the above will be defined if any error occurs (eg: fetching a repository that doesn't exists).
If has_found
is true
, then issue_number
and is_closed
will be defined as well.
Name | Description | Default |
---|---|---|
GITHUB_TOKEN |
GITHUB_TOKEN or a repo scoped Personal Access Token |
GITHUB_TOKEN secret created by GitHub |
You can use this action along with create-issue-from-file action, like:
# ...
- name: Find the last open report issue
id: last_issue
uses: micalevisk/last-issue-action@v1.2
with:
state: open
## The issue must have the following labels
labels: |
report
automated issue
env:
## Optional since it uses the `GITHUB_TOKEN` created by GitHub by default
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo ${{ steps.last_issue.outputs.issue_number }}
- name: Update last updated report issue
if: ${{ steps.last_issue.outputs.has_found == 'true' }}
uses: peter-evans/create-issue-from-file@v4
with:
title: Foo
content-filepath: README.md
issue-number: ${{ steps.last_issue.outputs.issue_number }}
labels: |
report
automated issue