chore: add advanced PR auto-labeling configuration and workflow (#3767)

# Description of Changes

Please provide a summary of the changes, including:

- Added `.github/labeler-config-srvaroa.yml` to define a comprehensive
auto-labeling configuration for PRs based on title patterns and file
paths.
- Introduced a new GitHub Actions workflow
`.github/workflows/auto-labelerV2.yml` that uses the `srvaroa/labeler`
action to automatically label pull requests.
- Extended `.github/labels.yml` to include missing label definitions
required for the auto-labeling setup (e.g., `Bugfix`, `build`, `ci`,
`perf`, etc.).

---

## Checklist

### General

- [ ] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [ ] I have performed a self-review of my own code
- [ ] My changes generate no new warnings

### Documentation

- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### UI Changes (if applicable)

- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

### Testing (if applicable)

- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
This commit is contained in:
Ludy 2025-06-18 23:27:50 +02:00 committed by GitHub
parent ddad1eddef
commit c080158b1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 198 additions and 0 deletions

136
.github/labeler-config-srvaroa.yml vendored Normal file
View File

@ -0,0 +1,136 @@
version: 1
labels:
- label: "Bugfix"
title: '^fix:.*'
- label: "enhancement"
title: '^feat:.*'
- label: "build"
title: '^build:.*'
- label: "chore"
title: '^chore:.*'
- label: "ci"
title: '^ci:.*'
- label: "perf"
title: '^perf:.*'
- label: "refactor"
title: '^refactor:.*'
- label: "revert"
title: '^revert:.*'
- label: "style"
title: '^style:.*'
- label: 'API'
title: '.*openapi.*'
- label: 'Translation'
files:
- 'stirling-pdf/src/main/resources/messages_[a-zA-Z_]{2}_[a-zA-Z_]{2,7}.properties'
- 'scripts/ignore_translation.toml'
- 'stirling-pdf/src/main/resources/templates/fragments/languages.html'
- '.github/scripts/check_language_properties.py'
- label: 'Front End'
files:
- 'stirling-pdf/src/main/resources/templates/**/*'
- 'proprietary/src/main/resources/templates/**/*'
- 'stirling-pdf/src/main/resources/static/**/*'
- 'proprietary/src/main/resources/static/**/*'
- 'stirling-pdf/src/main/java/stirling/software/SPDF/controller/web/**/*'
- 'stirling-pdf/src/main/java/stirling/software/SPDF/UI/**/*'
- label: 'Java'
files:
- 'common/src/main/java/**/*.java'
- 'proprietary/src/main/java/**/*.java'
- 'stirling-pdf/src/main/java/**/*.java'
- label: 'Back End'
files:
- 'stirling-pdf/src/main/java/stirling/software/SPDF/config/**/*'
- 'stirling-pdf/src/main/java/stirling/software/SPDF/controller/**/*'
- 'stirling-pdf/src/main/resources/settings.yml.template'
- 'stirling-pdf/src/main/resources/application.properties'
- 'stirling-pdf/src/main/resources/banner.txt'
- 'scripts/png_to_webp.py'
- 'split_photos.py'
- label: 'Security'
files:
- 'proprietary/src/main/java/stirling/software/proprietary/security/**/*'
- 'scripts/download-security-jar.sh'
- '.github/workflows/dependency-review.yml'
- '.github/workflows/scorecards.yml'
- label: 'API'
files:
- 'stirling-pdf/src/main/java/stirling/software/SPDF/config/OpenApiConfig.java'
- 'stirling-pdf/src/main/java/stirling/software/SPDF/controller/web/MetricsController.java'
- 'stirling-pdf/src/main/java/stirling/software/SPDF/controller/api/**/*'
- 'stirling-pdf/src/main/java/stirling/software/SPDF/model/api/**/*'
- 'scripts/png_to_webp.py'
- 'split_photos.py'
- '.github/workflows/swagger.yml'
- label: 'Documentation'
files:
- '**/*.md'
- 'scripts/counter_translation.py'
- 'scripts/ignore_translation.toml'
title: '^docs:.*'
- label: 'Docker'
files:
- '.github/workflows/build.yml'
- '.github/workflows/push-docker.yml'
- 'Dockerfile'
- 'Dockerfile.fat'
- 'Dockerfile.ultra-lite'
- 'exampleYmlFiles/*.yml'
- 'scripts/download-security-jar.sh'
- 'scripts/init.sh'
- 'scripts/init-without-ocr.sh'
- 'scripts/installFonts.sh'
- 'test.sh'
- 'test2.sh'
- label: 'Devtools'
files:
- '.devcontainer/**/*'
- 'Dockerfile.dev'
- '.vscode/**/*'
- '.editorconfig'
- '.pre-commit-config'
- '.github/workflows/pre_commit.yml'
- 'HowToAddNewLanguage.md'
- label: 'Test'
files:
- 'common/src/test/**/*'
- 'proprietary/src/test/**/*'
- 'stirling-pdf/src/test/**/*'
- 'testing/**/*'
- '.github/workflows/scorecards.yml'
- label: 'Github'
files:
- '.github/**/*'
- label: 'Gradle'
files:
- 'gradle/**/*'
- 'gradlew'
- 'gradlew.bat'
- 'settings.gradle'
- 'build.gradle'
- 'common/build.gradle'
- 'proprietary/build.gradle'
- 'stirling-pdf/build.gradle'

27
.github/labels.yml vendored
View File

@ -111,3 +111,30 @@
- name: "Devtools"
color: "FF9E1F"
description: "Development tools"
- name: "Bugfix"
color: "FF9E1F"
description: "Pull requests that fix bugs"
- name: "Gradle"
color: "FF9E1F"
description: "Pull requests that update Gradle code"
- name: "build"
color: "1E90FF"
description: "Changes that affect the build system or external dependencies"
- name: "chore"
color: "FFD700"
description: "Routine tasks or maintenance that don't modify src or test files"
- name: "ci"
color: "4682B4"
description: "Changes to CI configuration files and scripts"
- name: "perf"
color: "FF69B4"
description: "Changes that improve performance"
- name: "refactor"
color: "9932CC"
description: "Code changes that neither fix a bug nor add a feature"
- name: "revert"
color: "DC143C"
description: "Reverts a previous commit"
- name: "style"
color: "FFA500"
description: "Changes that do not affect the meaning of the code (formatting, etc.)"

35
.github/workflows/auto-labelerV2.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: "Auto Pull Request Labeler V2"
on:
pull_request_target:
types: [opened, synchronize]
permissions:
contents: read
jobs:
labeler:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup GitHub App Bot
id: setup-bot
uses: ./.github/actions/setup-bot
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- uses: srvaroa/labeler@0a20eccb8c94a1ee0bed5f16859aece1c45c3e55 # v1.13.0
with:
config_path: .github/labeler-config-srvaroa.yml
use_local_config: false
fail_on_error: true
env:
GITHUB_TOKEN: "${{ steps.setup-bot.outputs.token }}"