Auto-label PRs based on files + targeting release

This commit is contained in:
Wolfsblvt
2025-03-12 01:55:37 +01:00
parent 0237b6a872
commit 89ab138882
4 changed files with 55 additions and 2 deletions

29
.github/pr-auto-labels,yml vendored Normal file
View File

@@ -0,0 +1,29 @@
🏭 Backend Changes:
- "src/**"
- "server.js"
- "plugins.js"
- "recover.js"
- "webpack.config.js"
- "Start.bat"
- "start.sh"
- "UpdateAndStart.bat"
- "UpdateForkAndStart.bat"
🛠️ Build Changes:
- ".github/workflows/**"
- "docker/**"
- ".dockerignore"
- "Dockerfile"
- "webpack.config.js"
🌐 Language:
- "public/locales/**"
📥 Dependencies:
- "public/lib/**" # Every frontend lib counts as a dependency as well
- "package.json"
- "package-lock.json"
- "tests/package.json"
- "tests/package-lock.json"
- "src/electron/package.json"
- "src/electron/package-lock.json"

View File

@@ -20,7 +20,7 @@ jobs:
# https://github.com/marketplace/actions/regex-issue-labeler
uses: github/issue-labeler@v3
with:
configuration-path: .github/issues-auto-labeler.yml
configuration-path: .github/issues-auto-labels.yml
enable-versioned-regex: 0
repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}

View File

@@ -20,7 +20,7 @@ jobs:
commentOnDirty: "This pull request has conflicts. Please resolve them, otherwise it cannot be merged."
pr-size-labeler:
name: Label PR Size
name: Apply Label for PR Size
runs-on: ubuntu-latest
steps:
@@ -49,6 +49,30 @@ jobs:
"package-lock.json"
"public/lib/*"
label-release-prs:
name: Label PRs Targeting Release Branch
runs-on: ubuntu-latest
steps:
- name: Label PRs Targeting Release Branch
if: github.base_ref == 'release'
run: |
gh pr edit ${{ github.event.pull_request.number }} --add-label "❗ Against Release Branch"
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
apply-file-based-labels:
name: Apply Labels Based on Changed Files
runs-on: ubuntu-latest
steps:
- name: Apply Labels Based on Changed Files
# Pull Request Labeler
# https://github.com/marketplace/actions/labeler
uses: actions/labeler@v5
with:
repo-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
pr-auto-comments:
name: Post PR Comments Based on Labels
needs: [check-merge-conflicts, pr-size-labeler]