Issue States Save

:warning: PARTIALLY BROKEN - GitHub Action that closes or reopens issues when they are moved to a project column

Project README

Issue States

:warning: The action does not work with modern projects: https://github.com/dessant/issue-states/issues/2

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

  1. Create the issue-states.yml workflow file in the .github/workflows directory, use one of the example workflows to get started
  2. Start adding or moving issues to the project columns declared in open-issue-columns and closed-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 }}
  • 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 or false
    • Optional, defaults to false

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 of state is either open or closed
    • Defaults to ''

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@v3

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@v3
        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@v3
        with:
          github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

License

Copyright (c) 2018-2023 Armin Sebastian

This software is released under the terms of the MIT License. See the LICENSE file for further information.

Open Source Agenda is not affiliated with "Issue States" Project. README Source: dessant/issue-states
Stars
82
Open Issues
2
Last Commit
5 months ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating