Skip to content

Commit

Permalink
Check for backports in CI (#8304)
Browse files Browse the repository at this point in the history
(cherry picked from commit 88c80c1)
  • Loading branch information
Dreamsorcerer authored and patchback[bot] committed Apr 7, 2024
1 parent cebe526 commit 9827a32
Showing 1 changed file with 23 additions and 0 deletions.
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);

0 comments on commit 9827a32

Please sign in to comment.