Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
silverwind opened this issue Jul 4, 2023 · 6 comments
Closed

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

silverwind opened this issue Jul 4, 2023 · 6 comments

Comments

@silverwind
Copy link
Collaborator

silverwind commented Jul 4, 2023

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]
@yardenshoham
Copy link
Collaborator

I think it makes more sense to have the file here

@silverwind
Copy link
Collaborator Author

silverwind commented Jul 4, 2023

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
Copy link
Collaborator Author

silverwind commented Sep 1, 2023

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
Copy link
Collaborator Author

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

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

@silverwind
Copy link
Collaborator Author

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
Copy link
Collaborator

Agreed

@yardenshoham yardenshoham closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2023
techknowlogick pushed a commit to go-gitea/gitea that referenced this issue Sep 7, 2023
Implements GiteaBot/gitea-backporter#93 using
[`actions/labeler`](https://github.com/actions/labeler). Very basic
configuration, can be extended later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants