Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for backports in CI #8304

Merged
merged 17 commits into from
Apr 7, 2024
23 changes: 23 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Labels
on:
pull_request:
branches:
- 'master'
types: [labeled, opened, synchronize, reopened, unlabeled]

jobs:
backport:
runs-on: ubuntu-latest
name: Backport label added
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number
});
if (!pr.data.labels.find(l => l.name.startsWith("backport")))
process.exit(1);