Skip to content

Idea: Auto-Set labels based on modified path #93

Not planned
@silverwind

Description

@silverwind
Collaborator

From go-gitea/gitea#25667 (comment), I think it would be useful if the bot could auto-set some labels based on modified path. There are two kind of matching mechanisms needed:

  1. If any path is modified. For example, every change in Makefile should get a build label.
  2. If only a path is modified. For example a change only in docs should get a kind/docs label and maybe a skip-changelog, but a change that includes changes in docs and templates should not.

The config should be in the repo itself in .github/giteabot.yaml to be flexible to change:

autolabels:
  only:
    - globs: [docs/**]
      labels: [kind/docs, skip-changelog]
  any:
    - globs: [Makefile]
      labels: [build]

Activity

yardenshoham

yardenshoham commented on Jul 4, 2023

@yardenshoham
Collaborator

I think it makes more sense to have the file here

silverwind

silverwind commented on Jul 4, 2023

@silverwind
CollaboratorAuthor

Multiple benefits of having bot config in-repo:

  • Different config for different branches (may also be undesirable)
  • Bot is usable on more than one repo
silverwind

silverwind commented on Sep 1, 2023

@silverwind
CollaboratorAuthor

Something like this would be nice:

https://github.com/nodejs/node/blob/main/.github/label-pr-config.yml

Regex (with capture groups!) is the absolute flexibilty.

silverwind

silverwind commented on Sep 1, 2023

@silverwind
CollaboratorAuthor

BTW, Here is the repo for that bot which is acually just a action in disguise:

https://github.com/nodejs/node-pr-labeler

silverwind

silverwind commented on Sep 1, 2023

@silverwind
CollaboratorAuthor

Of course more generic actions for this exist, like https://github.com/actions/labeler, so I think we likely should not do it in this bot at all.

yardenshoham

yardenshoham commented on Sep 1, 2023

@yardenshoham
Collaborator

Agreed

added a commit that references this issue on Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @silverwind@yardenshoham

        Issue actions

          Idea: Auto-Set labels based on modified path · Issue #93 · GiteaBot/gitea-backporter