Skip to content

Bug: Add labels if they are missing when trying to auto-label #70

@jmeridth

Description

@jmeridth

Describe the bug

If a label is mentioned in .github/release-drafter.yml for auto-labeling and it is missing, we get an error like the following:

HttpError: You do not have permission to create labels on this repository

Since we're running the label with:

permissions:
  content: read
  pull-requests: write

That is to be expected.

To Reproduce

  1. add auto-labeling action from this repo to a repository
  2. wire-up release-drafter to a label that doesn't exist
  3. error

Expected behavior

If a label is mentioned in release-drafter.yml and doesn't exist, it should be created before being used. This might require higher permissions of the action. TBD.

Screenshots

No response

Additional context

Example where this occurred

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions