Matticusau / projectcard-autolabel

GitHub Action to automatically assign labels as the project card moves between columns of a project board

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

License Last commit Latest tag Issues Pull requests

projectcard-autolabel

GitHub Action to automatically assign labels as the project card moves between columns of a project board. Very versatile with plenty of configuration settings to adapt to many different implementations.

Currently supports the following functionality:

  • Automatically assign or remove labels based on Project Column a Card (issue) is moved to
  • Filter project ids to include / exclude
  • Filter project columns to action on

animation

Events

The Action can respond to the following workflow events:

Inputs

Set the following inputs in the workflow file

repo-token

Required The token to use for github authentication. Recommend using ${{ secrets.GITHUB_TOKEN }}. If additional access is required use a PAT/Secret and set it as a secret. More info see here.

If you have enabled Branch Protection rules then a PAT/Secret will need to be configured.

autolabel-config

Provide the project column configuration for the auto labeling based on column name pattern matches. JSON object as string, example format [{"column":"In progress", "add_labels":["in-progress"], "remove_labels":["triage"]}].

projectfilter-config

Provide the project patterns which will include/exclude projects. JSON object as string, example format {"include":["projectid"], "exclude":[]}.

Outputs

None

Example usage

Create the following file within your repo as .github/workflows/projectcard-autolabel.yml to configure an action.

name: ProjectCard Auto Labels

on:
  project_card:
    types: [moved]

jobs:
  projectcardautolabel_job:
    runs-on: ubuntu-latest
    steps:
    - name: Run ProjectCard AutoLabel
      id: runprojectcardautolabel
      uses: Matticusau/projectcard-autolabel@v1.0.0
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        autolabel-config: '[{"column":"In progress", "add_labels":["in-progress"], "remove_labels":["triage"]}]'

Note: The uses syntax includes tag/branch specification. For the latest release see tags.

To restrict the branches that this workflow executes on use this syntax

name: ProjectCard Auto Labels

on:
  project_card:
    types: [moved]
    branches:
      - master
jobs:
  ...

Example inputs

The action can be customized using the additional inputs on the workflow yaml file. This will always be read from the default branch of the repository, rather than custom yaml config files which can be overridden as they are read in the branch where the workflow is triggered from.

with:
  repo-token: ${{ secrets.GITHUB_TOKEN }}
  autolabel-config: '[{"column":"In progress", "add_labels":["in-progress"], "remove_labels":["triage"]}]'

Troubleshooting

If you are having issues running the action enable the debug logs as some additional logging has been built into the Action.

  1. To enable runner diagnostic logging, set the following secret in the repository that contains the workflow: ACTIONS_RUNNER_DEBUG to true.
  2. To download runner diagnostic logs, download the log archive of the workflow run. The runner diagnostic logs are contained in the runner-diagnostic-logs folder. For more information on downloading logs, see Downloading logs.

Enable debug logging

Known issues

None known at this time

About

GitHub Action to automatically assign labels as the project card moves between columns of a project board

License:MIT License


Languages

Language:JavaScript 90.4%Language:TypeScript 9.6%