@@ -37,38 +37,12 @@ permissions:
3737 contents : read
3838
3939jobs :
40- # Derive the commercial repo and branch names from the OSS inputs.
41- derive :
42- runs-on : ubuntu-latest
43- outputs :
44- commercial_repo : ${{ steps.derive.outputs.commercial_repo }}
45- commercial_branch : ${{ steps.derive.outputs.commercial_branch }}
46- steps :
47- - name : Derive commercial repo and branch
48- id : derive
49- shell : bash
50- run : |
51- OSS_REPO="${{ inputs.oss_repo }}"
52- OSS_TAG="${{ inputs.oss_tag }}"
53- # commercial repo is always the OSS repo with -commercial appended
54- COMMERCIAL_REPO="${OSS_REPO}-commercial"
55- # strip leading 'v' and append '.x' (v5.0.1 -> 5.0.1.x)
56- COMMERCIAL_BRANCH="${OSS_TAG#v}.x"
57- echo "commercial_repo=${COMMERCIAL_REPO}" >> "$GITHUB_OUTPUT"
58- echo "commercial_branch=${COMMERCIAL_BRANCH}" >> "$GITHUB_OUTPUT"
59- echo "OSS repo: $OSS_REPO"
60- echo "OSS tag: $OSS_TAG"
61- echo "Commercial repo: $COMMERCIAL_REPO"
62- echo "Commercial branch: $COMMERCIAL_BRANCH"
63-
6440 initialize :
65- needs : derive
6641 uses : ./.github/workflows/initialize-commercial-branch.yml
6742 with :
68- oss_repo : ${{ inputs.oss_repo }}
69- oss_tag : ${{ inputs.oss_tag }}
70- commercial_repo : ${{ needs.derive.outputs.commercial_repo }}
71- commercial_branch : ${{ needs.derive.outputs.commercial_branch }}
43+ oss_repo : ${{ inputs.oss_repo }}
44+ oss_tag : ${{ inputs.oss_tag }}
45+ commercial_repo : ${{ format('{0}-commercial', inputs.oss_repo) }}
46+ commercial_branch : ${{ format('{0}.x', replace(inputs.oss_tag, 'v', '')) }}
7247 set_default_branch : false
73- secrets :
74- token : ${{ secrets.token || secrets.GH_ACTIONS_REPO_TOKEN }}
48+ secrets : inherit
0 commit comments