issue-states
issue-states copied to clipboard
:warning: PARTIALLY BROKEN - GitHub Action that closes or reopens issues when they are moved to a project column
Issue States
Issue States is a GitHub Action that closes or reopens issues when they are moved to a project column.
Supporting the Project
The continued development of Issue States is made possible thanks to the support of awesome backers. If you'd like to join them, please consider contributing with Patreon, PayPal or Bitcoin.
Usage
- Create the
issue-states.yml
workflow file in the.github/workflows
directory, use one of the example workflows to get started - Start adding or moving issues to the project columns declared
in
open-issue-columns
andclosed-issue-columns
Issues which were already in the respective columns before the action was set up will not be processed. To process these issues, move them to a different column, then move them back.
Care must be taken during the use of the action to not conflict with project automation presets on GitHub.
Inputs
The action can be configured using input parameters.
-
github-token
- GitHub access token, value must be
${{ github.token }}
or an encrypted secret that contains a personal access token - Optional, defaults to
${{ github.token }}
- GitHub access token, value must be
-
open-issue-columns
- Reopen issues that are moved to these project columns, value must be a comma separated list of project columns
- Optional, defaults to
''
-
closed-issue-columns
- Close issues that are moved to these project columns, value must be a comma separated list of project columns
- Optional, defaults to
Closed, Done
-
log-output
- Log output parameters, value must be either
true
orfalse
- Optional, defaults to
false
- Log output parameters, value must be either
Outputs
-
issues
- Issues that have been either closed or reopened, value is a JSON string
in the form of
[{"owner": "actions", "repo": "toolkit", "issue_number": 1, "state": "closed"}]
, value ofstate
is eitheropen
orclosed
- Defaults to
''
- Issues that have been either closed or reopened, value is a JSON string
in the form of
Examples
The following workflow will close issues when they are moved
to the Closed
or Done
project column.
name: 'Issue States'
on:
project_card:
types: [created, edited, moved]
permissions:
repository-projects: read
issues: write
pull-requests: write
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/issue-states@v2
Available input parameters
This workflow declares all the available input parameters of the action and their default values. Any of the parameters can be omitted.
name: 'Issue States'
on:
project_card:
types: [created, edited, moved]
permissions:
repository-projects: read
issues: write
pull-requests: write
jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/issue-states@v2
with:
github-token: ${{ github.token }}
open-issue-columns: ''
closed-issue-columns: 'Closed, Done'
log-output: false
Using a personal access token
The action uses an installation access token by default to interact with GitHub.
You may also authenticate with a personal access token to perform actions
as a GitHub user instead of the github-actions
app.
Create a personal access token
with the repo
or public_repo
scopes enabled, and add the token as an
encrypted secret
for the repository or organization, then provide the action with the secret
using the github-token
input parameter.
steps:
- uses: dessant/issue-states@v2
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
License
Copyright (c) 2018-2021 Armin Sebastian
This software is released under the terms of the MIT License. See the LICENSE file for further information.