Skip to content

Commit 88c80c1

Browse files
Check for backports in CI (#8304)
1 parent 7d0be3f commit 88c80c1

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/labels.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Labels
2+
on:
3+
pull_request:
4+
branches:
5+
- 'master'
6+
types: [labeled, opened, synchronize, reopened, unlabeled]
7+
8+
jobs:
9+
backport:
10+
runs-on: ubuntu-latest
11+
name: Backport label added
12+
steps:
13+
- uses: actions/github-script@v7
14+
with:
15+
github-token: ${{ secrets.GITHUB_TOKEN }}
16+
script: |
17+
const pr = await github.rest.pulls.get({
18+
owner: context.repo.owner,
19+
repo: context.repo.repo,
20+
pull_number: context.payload.pull_request.number
21+
});
22+
if (!pr.data.labels.find(l => l.name.startsWith("backport")))
23+
process.exit(1);

0 commit comments

Comments
 (0)