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 8484 run : python3 -u ci_set_matrix.py
8585 working-directory : tools
8686 env :
87+ PULL : ${{ github.event.number }}
8788 LAST_FAILED_JOBS : ${{ steps.get-last-commit-with-checks.outputs.check_runs }}
8889
8990 tests :
@@ -294,3 +295,5 @@ jobs:
294295 with :
295296 boards : ${{ toJSON(fromJSON(needs.scheduler.outputs.ports)[matrix.port]) }}
296297 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():
7575 sha = os .environ ["GITHUB_SHA" ]
7676
7777 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 } "
7992
8093 return sha , version
8194
You can’t perform that action at this time.
0 commit comments