8000 GitHub - micalevisk/last-issue-action at v1.2.4
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

micalevisk/last-issue-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Find Last Issue

GitHub Action to find and output the number of last updated issue that has given labels and state.

Action inputs

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": if you want to look up for open issues only
  • "closed": if you want to look up for closed issues only
  • "all": if you want to look up for open or closed ones
"open"

Action outputs

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.

Environment variables

Name Description Default
GITHUB_TOKEN GITHUB_TOKEN or a repo scoped Personal Access Token GITHUB_TOKEN secret created by GitHub

Example usage

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

About

GitHub Action to find and output the number of the last updated open issue that has given labels and state.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
0