Skip to content
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

Auto label PRs #1518

Merged
merged 14 commits into from
May 30, 2024
45 changes: 45 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Config file for pr-auto-label workflow

# enable auto-labeler on issues, prs, or both.
enable:
prs: true

comments:
prs: |
Thanks for the contribution!
I have applied any labels matching special text in your title and description.

Please review the labels and make any necessary changes.

# Labels is an object where:
# - keys are labels
# - values are objects of { include: [ pattern ], exclude: [ pattern ] }
# - pattern must be a valid regex, and is applied globally to
# title + description of issues and/or prs (see enabled config above)
# - 'include' patterns will associate a label if any of these patterns match
# - 'exclude' patterns will ignore this label if any of these patterns match
labels:
'kind/CLEANUP':
include:
- '(/kind (chore|cleanup))|(chore|cleanup):'
exclude: []
'kind/BUGFIX':
include:
- '(/kind (fix|bugfix))|(fix|bugfix):'
exclude: []
'kind/ENHANCEMENT':
include:
- '(/kind enhancement)|enhancement:'
exclude: []
'kind/FEATURE':
include:
- '(/kind (feat|feature))|(feat|feature):'
exclude: []
'kind/CHANGE':
include:
- '(/kind docs)|docs:'
exclude: []
'release-note-none':
include:
- '(/kind (NONE|release-note-none|release-notes-none))|(NONE|release-note-none|release-notes-none)'
exclude: []
28 changes: 28 additions & 0 deletions .github/workflows/pr-auto-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: PR-auto-labeler

on:
pull_request_target:
types: [labeled, unlabeled, opened, edited, synchronize]

permissions:
# Setting up permissions in the workflow to limit the scope of what it can do. Optional!
contents: read # the config file
issues: write # for labeling issues (on: issues)
pull-requests: write # for labeling pull requests (on: pull_request_target or on: pull_request)
statuses: write # to generate status
checks: write # to generate status

jobs:

labeler:
runs-on: ubuntu-latest

steps:
- name: Check Labels
id: labeler
uses: jimschubert/labeler-action@v1
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

# Adjust the configuration in /.github/labeler.yml
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Prometheus uses GitHub to manage reviews of pull requests.
Practices for Production
Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style).

* Be sure to sign off on the [DCO](https://github.com/probot/dco#how-it-works)
* Be sure to sign off on the [DCO](https://github.com/probot/dco#how-it-works)
Loading