File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 - ' release/*.*.x'
1717
1818jobs :
19- prepare-labels :
20- # Only run if 'backport/all' is present on a merged PR
21- if : github.event.pull_request.merged && contains(github.event.pull_request.labels.*.name, 'backport/all')
22- runs-on : ubuntu-latest
23- steps :
24- - name : Checkout code
25- uses : actions/checkout@v4
26-
27- - name : Extract Versions and Apply Labels
28- env :
29- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30- PR_NUMBER : ${{ github.event.pull_request.number }}
31- run : |
32- # 1. Extract version numbers from the HCL file (assuming file is named 'versions.hcl')
33- # This looks for lines like: version "1.22" {
34- # And extracts: 1.22
35- VERSIONS=$(grep -oE 'version "[0-9]+\.[0-9]+"' .release/versions.hcl | cut -d'"' -f2)
36-
37- if [ -z "$VERSIONS" ]; then
38- echo "No versions found in file. Exiting."
39- exit 1
40- fi
41-
42- # 2. Loop through and apply labels
43- for v in $VERSIONS; do
44- echo "Processing version: $v"
45- gh pr edit $PR_NUMBER --add-label "backport/$v"
46- gh pr edit $PR_NUMBER --add-label "backport/ent/$v"
47- done
4819 backport :
4920 if : github.event.pull_request.merged
5021 runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments