Skip to content

jop-software/github-labels-as-code-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

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub labels as code Action

Store your issue labels as code in your repository.

Inputs

Name Description Default
token Token to use to authorize label changes. (See Github Tokens) ${{ github.token }}
file Path to the file you store your labels in. ./.github/labels.json

Example usage

uses: jop-software/[email protected]
with:
  token: "${{ github.token }}"
  file: "./.github/labels.json"

Note: You need to execute this action after actions/checkout

If you want to see a real example of this action, take a look at the workflows from this repository 😉

Github Tokens

On Feb. 2, 2023 GitHub announced in a blog post that new generated GHA Tokens in repository will be read only by defaut.
Therefore, when you add the action to a repository created after 2023-02-02 you need to make sure to provide a GitHub token that has write access to update issue labels. This can be toggled in the repository settings.
When you are using inheritence for repository permissions, please read the GitHub Blog Post explaining that change.

JSON Format

The expected JSON format follows the Body parameters from the Create a label GitHub Rest API endpoint.

See the following example:

[
  {
    "name": "Bug",                            // <- String
    "description": "Something isn't working", // <- String (max 100 chars, optional)
    "color": "d73a4a"                         // <- String (hexadecimal color code without the leading #) 
  }
  // ...
]

Professional Support

Professional support is available, contact [email protected] for more information.

© 2023, jop-software Inh. Johannes Przymusinski