File tree Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change 1
- name : Label docs PRs for ROS Sync
1
+ name : Label docs PRs for backports
2
2
on :
3
3
pull_request :
4
+ branches :
5
+ - humble
6
+ - jazzy
7
+ - kilted
4
8
5
9
jobs :
6
10
label-docs :
7
- if : contains(github.event.pull_request.title, 'Kilted Sync') || contains(github.event.pull_request.title, 'Jazzy Sync')
8
11
runs-on : ubuntu-latest
9
12
steps :
10
13
- name : Process docs PRs
11
14
env :
12
- GH_TOKEN : ${{ github.token }}
15
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
13
16
run : |
14
- # Determine ROS distro and label from PR title
15
- pr_title="${{ github.event.pull_request.title }}"
16
-
17
- if [[ "$pr_title" == *"Kilted Sync"* ]]; then
18
- ros_distro="kilted"
19
- label="backport-kilted"
20
-
21
- elif [[ "$pr_title" == *"Jazzy Sync"* ]]; then
22
- ros_distro="jazzy"
23
- label="backport-jazzy"
24
- fi
25
-
26
17
# Get PR numbers from commits
27
18
prs=$(gh api repos/ros-navigation/navigation2/pulls/${{ github.event.number }}/commits \
28
19
--jq '.[].commit.message' | grep -o '#[0-9]\+' | tr -d '#' | sort -u)
29
20
30
21
# Find and label docs PRs
22
+ docs_pr_found=false
23
+ label="backport-${{ github.event.pull_request.base.ref }}"
24
+
31
25
for pr in $prs; do
32
26
33
27
# Get cross-referenced events
38
32
if [ -n "$docs_pr" ]; then
39
33
echo "Labeling docs PR #$docs_pr with '$label'"
40
34
gh pr edit $docs_pr --repo ros-navigation/docs.nav2.org --add-label "$label"
35
+ docs_pr_found=true
41
36
else
42
37
echo "No cross-referenced docs PR found for navigation2 PR #$pr"
43
38
fi
44
39
done
40
+
41
+ # Fail if no docs PRs were found
42
+ if [ "$docs_pr_found" = false ]; then
43
+ echo "ERROR: No docs PRs found for this backport"
44
+ exit 1
45
+ fi
You can’t perform that action at this time.
0 commit comments