File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 84
84
run : python3 -u ci_set_matrix.py
85
85
working-directory : tools
86
86
env :
87
+ PULL : ${{ github.event.number }}
87
88
LAST_FAILED_JOBS : ${{ steps.get-last-commit-with-checks.outputs.check_runs }}
88
89
89
90
tests :
@@ -294,3 +295,5 @@ jobs:
294
295
with :
295
296
boards : ${{ toJSON(fromJSON(needs.scheduler.outputs.ports)[matrix.port]) }}
296
297
cp-version : ${{ needs.scheduler.outputs.cp-version }}
298
+ env :
299
+ PULL : ${{ github.event.number }}
Original file line number Diff line number Diff line change @@ -75,7 +75,20 @@ def get_version_info():
75
75
sha = os .environ ["GITHUB_SHA" ]
76
76
77
77
if not version :
78
- version = "{}-{}" .format (date .today ().strftime ("%Y%m%d" ), sha [:7 ])
78
+ # Get branch we are PR'ing into, if any.
79
+ branch = os .environ .get ("GITHUB_BASE_REF" , "" ).strip ().replace ("/" , "_" )
80
+ if not branch :
81
+ branch = "no-branch"
82
+
83
+ # Get PR number, if any
84
+ pull_request_maybe = os .environ .get ("PULL" , "" )
85
+ if pull_request_maybe :
86
+ pull_request_maybe = f"-PR{ pull_request_maybe } "
87
+
88
+ date_stamp = date .today ().strftime ("%Y%m%d" )
89
+ short_sha = sha [:7 ]
90
+ # Example: 20231121-8.2.x-PR9876-123abcd
91
+ version = f"{ date_stamp } -{ branch } { pull_request_maybe } -{ short_sha } "
79
92
80
93
return sha , version
81
94
You can’t perform that action at this time.
0 commit comments