Skip to content

Commit 59dc65a

Browse files
Christopher Friedtstephanosio
authored andcommitted
ci: backports: check if a backport PR has a valid issue
This is an automated check for the Backports project to require one or more `Fixes #<issue>` items in the body of the pull request. Fixes #46164 Signed-off-by: Christopher Friedt <[email protected]> (cherry picked from commit aa4e437)
1 parent 8ff8caf commit 59dc65a

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Backport Issue Check
2+
3+
on:
4+
pull_request_target:
5+
branches:
6+
- v*-branch
7+
8+
jobs:
9+
backport:
10+
name: Backport Issue Check
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check out source code
15+
uses: actions/checkout@v2
16+
17+
- name: Install Python dependencies
18+
run: |
19+
sudo pip3 install -U setuptools wheel pip
20+
pip3 install -U pygithub
21+
22+
- name: Run backport issue checker
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.ZB_GITHUB_TOKEN }}
25+
run: |
26+
./scripts/release/list_backports.py \
27+
-o ${{ github.event.repository.owner.login }} \
28+
-r ${{ github.event.repository.name }} \
29+
-b ${{ github.event.pull_request.base.ref }} \
30+
-p ${{ github.event.pull_request.number }}

scripts/release/list_backports.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,7 @@ def get_issues(self):
254254
self._pulls_without_an_issue.append(p)
255255
continue
256256

257-
# FIXME: when we have upgrade to python3.9+, use "issue_map | issues_for_this_pr"
258-
issue_map = {**issue_map, **issues_for_this_pr}
257+
issue_map = issue_map | issues_for_this_pr
259258

260259
issues = list(issue_map.values())
261260

0 commit comments

Comments
 (0)