Skip to content

test

test #2503

name: 'Label Check'
on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]
jobs:
check-label:
runs-on: ubuntu-latest
steps:
- name: Check labels
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
script: |
const labels = context.payload.pull_request.labels;
const releaseLabels = ['kind/breaking-change', 'kind/product-feature', 'kind/bug', 'kind/other', 'kind/dependencies', 'ignore-for-release'];
if(!releaseLabels.some(r=>labels.some(l=>l.name == r))){
core.setFailed(`The PR must have at least one of these labels: ${releaseLabels}`)
}
const backportLabels = ["backport", "backport-ignore"];
if(!backportLabels.some(r=>labels.some(l=>l.name == r))){
core.setFailed(`The PR must have at least one of these labels: ${backportLabels}`)
}