mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-05-23 09:51:55 -04:00
Chore: improve PR labeling move all labelling to pr-bot workflow (#9970)
This commit is contained in:
parent
0a03ca94c7
commit
e092627da6
7
.github/labeler.yml
vendored
7
.github/labeler.yml
vendored
@ -17,3 +17,10 @@ ci-cd:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- '.github/**'
|
||||
# pr types
|
||||
bug:
|
||||
- head-branch:
|
||||
- ['^fix']
|
||||
enhancement:
|
||||
- head-branch:
|
||||
- ['^feature']
|
||||
|
14
.github/release-drafter.yml
vendored
14
.github/release-drafter.yml
vendored
@ -1,15 +1,3 @@
|
||||
autolabeler:
|
||||
- label: "bug"
|
||||
branch:
|
||||
- '/^fix/'
|
||||
title:
|
||||
- "/^fix/i"
|
||||
- "/^Bugfix/i"
|
||||
- label: "enhancement"
|
||||
branch:
|
||||
- '/^feature/'
|
||||
title:
|
||||
- "/^feature/i"
|
||||
categories:
|
||||
- title: 'Breaking Changes'
|
||||
labels:
|
||||
@ -17,7 +5,7 @@ categories:
|
||||
- title: 'Notable Changes'
|
||||
labels:
|
||||
- 'notable'
|
||||
- title: 'Features'
|
||||
- title: 'Features / Enhancements'
|
||||
labels:
|
||||
- 'enhancement'
|
||||
- title: 'Bug Fixes'
|
||||
|
28
.github/workflows/pr-bot.yml
vendored
28
.github/workflows/pr-bot.yml
vendored
@ -10,7 +10,8 @@ jobs:
|
||||
name: Automated PR Bot
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Label by file path
|
||||
- name: Label PR by file path or branch name
|
||||
# see .github/labeler.yml for the labeler config
|
||||
uses: actions/labeler@v5
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@ -24,6 +25,31 @@ jobs:
|
||||
s_diff: '99999'
|
||||
fail_if_xl: 'false'
|
||||
excluded_files: /\.lock$/ /\.txt$/ ^src-ui/pnpm-lock\.yaml$ ^src-ui/messages\.xlf$ ^src/locale/en_US/LC_MESSAGES/django\.po$
|
||||
- name: Label by PR title
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const pr = context.payload.pull_request;
|
||||
const title = pr.title.toLowerCase();
|
||||
const labels = [];
|
||||
|
||||
if (/^(fix|bugfix)/i.test(title)) {
|
||||
labels.push('bug');
|
||||
} else if (/^feature/i.test(title)) {
|
||||
labels.push('enhancement');
|
||||
} else {
|
||||
labels.push('enhancement'); // Default fallback
|
||||
}
|
||||
|
||||
if (labels.length) {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pr.number,
|
||||
labels,
|
||||
});
|
||||
core.info(`Added labels based on title: ${labels.join(', ')}`);
|
||||
}
|
||||
- name: Label bot-generated PRs
|
||||
if: ${{ contains(github.actor, 'dependabot') || contains(github.actor, 'crowdin-bot') }}
|
||||
uses: actions/github-script@v7
|
||||
|
Loading…
x
Reference in New Issue
Block a user