mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-14 10:58:59 -04:00
27 lines
943 B
YAML
27 lines
943 B
YAML
name: Check PR Labels
|
|
|
|
on:
|
|
pull_request:
|
|
types: [edited, labeled]
|
|
|
|
permissions:
|
|
pull-requests: read
|
|
contents: read
|
|
|
|
jobs:
|
|
check-label:
|
|
runs-on: ubuntu-24.04-arm
|
|
steps:
|
|
- name: Check for PR labels
|
|
uses: actions/github-script@v9
|
|
with:
|
|
script: |
|
|
// Extract labels from the payload directly to avoid extra API calls
|
|
const latestLabels = context.payload.pull_request.labels.map(label => label.name);
|
|
const requiredLabels = ['bugfix', 'enhancement', 'automation', 'dependencies', 'repo', 'release', 'refactor'];
|
|
console.log('Labels from payload:', latestLabels);
|
|
const hasRequiredLabel = latestLabels.some(label => requiredLabels.includes(label));
|
|
if (!hasRequiredLabel) {
|
|
core.setFailed(`PR must have at least one of the following labels before it can be merged: ${requiredLabels.join(', ')}.`);
|
|
}
|