This reusable workflow can add a label and/or project to an issue, as well as set one field in the project. The motivation behind it is to assign an initial triage status to new issues as they are created.
- issue-id - The node_id of the issue to act upon, required.
- label - The name of the label to add to the issue, optional.
- repo-project, user-project, org-project - Define one (projects can live at the repo, user, or org level) or none of these; the name of the project to add the issue to.
- project-field - An optional definition of a
field-name=valuepair to set on the project's entry for this issue. OnlyTEXT&SINGLE_SELECTfield types are supported. - token - A required secret. This needs to have permissions to write to issues (if
labelis set), and write permission to projects if the project related options are set. - skip-if-existing-project - An optional boolean. If set to true and the issue is already assigned to any projects, no action will be taken.
Example:
jobs:
handle_new_issue:
uses: AntelopeIO/issue-project-labeler-workflow/.github/workflows/issue-project-labeler.yaml@v1
with:
issue-id: ${{github.event.issue.node_id}}
label: triage
org-project: 'My Org Project'
project-field: Status=Todo
secrets:
token: ${{secrets.REPO_PROJECT_TOKEN}}