mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
move label checker into same pipeline (#2597)
This commit is contained in:
parent
99b4baf9a1
commit
446cf81bd0
3 changed files with 21 additions and 39 deletions
21
.github/workflows/pull-request.yml
vendored
21
.github/workflows/pull-request.yml
vendored
|
|
@ -4,6 +4,8 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch: # Allow manual triggering
|
||||
|
||||
|
||||
concurrency:
|
||||
group: build-pr-${{ github.ref }}
|
||||
|
|
@ -47,3 +49,22 @@ jobs:
|
|||
}
|
||||
exit_on_result "build_and_detekt" "${{ needs.build_and_detekt.result }}"
|
||||
exit_on_result "androidTest" "${{ needs.androidTest.result }}"
|
||||
|
||||
check-label:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
[
|
||||
check-workflow-status,
|
||||
]
|
||||
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