mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
labeler tweaks (#2617)
This commit is contained in:
parent
f7eb10c17b
commit
2daf1ba67b
4 changed files with 44 additions and 35 deletions
25
.github/workflows/pr_enforce_labels.yml
vendored
Normal file
25
.github/workflows/pr_enforce_labels.yml
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
name: Check PR Labels
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [edited, labeled]
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
check-label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check for PR labels
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const labels = context.payload.pull_request.labels.map(label => label.name);
|
||||
const requiredLabels = ['bugfix', 'enhancement', 'automation', 'dependencies', 'repo', 'release'];
|
||||
const hasRequiredLabel = labels.some(label => requiredLabels.includes(label));
|
||||
console.log(labels);
|
||||
if (!hasRequiredLabel) {
|
||||
core.setFailed(`PR must have at least one of the following labels before it can be merged: ${requiredLabels.join(', ')}.`);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue