Skip to content

Commit 292d961

Browse files
[PR #8304/88c80c14 backport][3.9] Check for backports in CI (#8305)
**This is a backport of PR #8304 as merged into master (88c80c1).** Co-authored-by: Sam Bull <[email protected]>
1 parent cebe526 commit 292d961

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)