File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 description : ' The minor release branch name (e.g. release/v1.54.x)'
88 required : true
99 type : string
10- # run workflow when any branch is created
10+ # run workflow when any branch or tag is created
1111 create :
1212
1313jobs :
14- # TODO: Remove this job after confirming the github.ref when a release branch is created
14+ # TODO: Remove this job after confirming the workflow succeeds for release branches
1515 print-github-ref :
1616 name : " Print full github.ref"
1717 runs-on : ubuntu-latest
2222
2323 pin-system-tests :
2424 name : " Pin system tests"
25- if : github.event_name != 'create' || contains(github.ref, 'release /v')
25+ if : github.event_name != 'create' || ( contains(github.ref, 'tags /v') && endsWith(github.ref, '.0') )
2626 runs-on : ubuntu-latest
2727 permissions :
2828 contents : write
4040 if [[ -n "${{ github.event.inputs.release-branch-name }}" ]]; then
4141 BASE_BRANCH=${{ github.event.inputs.release-branch-name }}
4242 else
43- BASE_BRANCH=${GITHUB_REF#refs/heads/}
43+ # Convert tag (e.g. v1.54.0) to release branch name (e.g. release/v1.54.x)
44+ TAG=${GITHUB_REF#refs/tags/}
45+ if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.0$ ]]; then
46+ BASE_BRANCH="release/${TAG%.0}.x"
47+ else
48+ echo "ERROR: Tag $TAG is not in the expected format: vX.Y.0"
49+ exit 1
50+ fi
4451 fi
4552 echo "base_branch=${BASE_BRANCH}" >> $GITHUB_OUTPUT
4653
You can’t perform that action at this time.
0 commit comments