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 |
uses: jop-software/github-labels-as-code-action@v1.0
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 😉
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.
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 is available, contact support@jop-software.de for more information.