File tree 2 files changed +26
-2
lines changed
2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1
1
# SPDX-FileCopyrightText: (C) 2025 Intel Corporation
2
2
# SPDX-License-Identifier: Apache-2.0
3
3
4
- CI 🤖 :
4
+ CI🤖 :
5
5
- changed-files :
6
6
- any-glob-to-any-file : " .github/**"
7
7
Original file line number Diff line number Diff line change 15
15
label :
16
16
runs-on : ubuntu-latest
17
17
steps :
18
- - uses : actions/labeler@v5
18
+ - uses : actions/checkout@v4
19
+ - name : " Push labels"
20
+ id : labeler
21
+ uses : actions/labeler@v5
22
+ - name : " Push labels to PR title"
23
+ if : steps.labeler.outputs.all-labels != ''
24
+ shell : bash
25
+ run : |
26
+ valid_labels="CI🤖|root|infra-core|infra-external|infra-manager|infra-onboarding"
27
+
28
+ labels=$(echo "${{ steps.labeler.outputs.all-labels }}" | grep -oE "$valid_labels" | tr '\n' ',' | sed 's/,$//')
29
+ old_pr_title="${{ github.event.pull_request.title }}"
30
+ new_pr_title=$(echo "$old_pr_title" | sed -n 's/^\[\([^]]*\)\] *//p')
31
+ if [ -z "$new_pr_title" ]; then
32
+ new_pr_title="$old_pr_title"
33
+ fi
34
+ new_pr_title="[$labels] ${new_pr_title}"
35
+ echo "Labels: $labels"
36
+ echo "Old PR title: $old_pr_title"
37
+ echo "New PR title: $new_pr_title"
38
+ curl -s -X PATCH \
39
+ -H "Authorization: Bearer ${{ secrets.SYS_ORCH_GITHUB }}" \
40
+ -H "Accept: application/vnd.github.v3+json" \
41
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}" \
42
+ -d '{"title": "'"$new_pr_title"'"}' > /dev/null
You can’t perform that action at this time.
0 commit comments