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
8
.github/labeler.yml
vendored
8
.github/labeler.yml
vendored
|
|
@ -10,19 +10,19 @@
|
||||||
|
|
||||||
# Add 'enhancement' label to any PR where the head branch name contains `feat`
|
# Add 'enhancement' label to any PR where the head branch name contains `feat`
|
||||||
enhancement:
|
enhancement:
|
||||||
- head-branch: ['feat']
|
- head-branch: [feat, Feat, FEAT]
|
||||||
|
|
||||||
# Add 'repo' label to any PR where the head branch name contains `repo`
|
# Add 'repo' label to any PR where the head branch name contains `repo`
|
||||||
# or files in the .github dir
|
# or files in the .github dir
|
||||||
repo:
|
repo:
|
||||||
- any:
|
- any:
|
||||||
- head-branch: ['repo']
|
- head-branch: [repo, Repo]
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file: '.github'
|
- any-glob-to-any-file: .github
|
||||||
|
|
||||||
# Add 'bug' label to any PR where the head branch name contains `fix` or `bug`
|
# Add 'bug' label to any PR where the head branch name contains `fix` or `bug`
|
||||||
bugfix:
|
bugfix:
|
||||||
- head-branch: ['fix', 'bug']
|
- head-branch: [fix, bug, Fix, FIX, Bug, BUG]
|
||||||
|
|
||||||
# our fallback - bug except repo, feat, or automated pipelines
|
# our fallback - bug except repo, feat, or automated pipelines
|
||||||
# bug_fallthrough:
|
# bug_fallthrough:
|
||||||
|
|
|
||||||
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(', ')}.`);
|
||||||
|
}
|
||||||
15
.github/workflows/pull-request-target.yml
vendored
Normal file
15
.github/workflows/pull-request-target.yml
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
name: "Pull Request Labeler"
|
||||||
|
on:
|
||||||
|
- pull_request_target
|
||||||
|
# Do not execute arbitary code on this workflow.
|
||||||
|
# See warnings at https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
labeler:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- id: label-the-PR
|
||||||
|
uses: actions/labeler@v5
|
||||||
31
.github/workflows/pull-request.yml
vendored
31
.github/workflows/pull-request.yml
vendored
|
|
@ -56,34 +56,3 @@ jobs:
|
||||||
}
|
}
|
||||||
exit_on_result "build_and_detekt" "${{ needs.build_and_detekt.result }}"
|
exit_on_result "build_and_detekt" "${{ needs.build_and_detekt.result }}"
|
||||||
exit_on_result "androidTest" "${{ needs.androidTest.result }}"
|
exit_on_result "androidTest" "${{ needs.androidTest.result }}"
|
||||||
|
|
||||||
labeler:
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- id: label-the-PR
|
|
||||||
uses: actions/labeler@v5
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
check-label:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs:
|
|
||||||
[
|
|
||||||
check-workflow-status,
|
|
||||||
labeler
|
|
||||||
]
|
|
||||||
if: always()
|
|
||||||
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