Skip to content

vellum:72b5a0d30d7cecacd22981c55d91d7e906dc4ac0 #1513

vellum:72b5a0d30d7cecacd22981c55d91d7e906dc4ac0

vellum:72b5a0d30d7cecacd22981c55d91d7e906dc4ac0 #1513

Workflow file for this run

name: Labels
on:
pull_request:
branches:
- master
types: [labeled, unlabeled, opened, reopened]
jobs:
check_product_label:
name: 🏷️ Require a product label
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- name: Report product label check
uses: actions/github-script@v7
with:
script: |
const labels = context.payload.pull_request.labels.map(l => l.name);
const hasProductLabel = labels.some(l => l.startsWith('product/'));
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Product label',
head_sha: context.payload.pull_request.head.sha,
status: 'completed',
conclusion: hasProductLabel ? 'success' : 'failure',
output: {
title: hasProductLabel ? 'Product label present' : 'Missing product label',
summary: hasProductLabel
? 'A product/ label is present on this PR.'
: 'This PR requires a product/ label before it can be merged.',
},
});