require backport label for pr into main #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Require Backport Label | |
on: | |
pull_request: | |
types: [opened, labeled, unlabeled, synchronize] | |
branches: | |
- main | |
jobs: | |
require-backport-label: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check for backport label | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const labels = context.payload.pull_request.labels.map(label => label.name); | |
if (!labels.includes('backport')) { | |
core.setFailed('Pull request must have a backport label'); | |
} |