Skip to content

Adjusted pr label check #6

Adjusted pr label check

Adjusted pr label check #6

Workflow file for this run

name: Enforce PR Label
on:
pull_request:
types: [opened, edited, unlabeled]
push:
branches:
- '**'
jobs:
check-label:
runs-on: ubuntu-latest
steps:
- name: Check for labels
uses: actions/github-script@v6
with:
script: |
if (context.eventName === 'push') {
console.log('Skipping label check for push event.');
return;
}
const labels = context.payload.pull_request?.labels || [];
if (labels.length === 0) {
throw new Error('This pull request must have at least one label.');
}