Skip to content

Commit bcb2eff

Browse files
committed
Add hotfix workflow
1 parent bbe384e commit bcb2eff

2 files changed

Lines changed: 10 additions & 60 deletions

File tree

.github/workflows/create-commercial-branch.yml

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -45,36 +45,12 @@ permissions:
4545
contents: read
4646

4747
jobs:
48-
# Derive the commercial repo and branch names from the OSS inputs.
49-
derive:
50-
runs-on: ubuntu-latest
51-
outputs:
52-
commercial_repo: ${{ steps.derive.outputs.commercial_repo }}
53-
commercial_branch: ${{ steps.derive.outputs.commercial_branch }}
54-
steps:
55-
- name: Derive commercial repo and branch
56-
id: derive
57-
shell: bash
58-
run: |
59-
OSS_REPO="${{ inputs.oss_repo }}"
60-
OSS_BRANCH="${{ inputs.oss_branch }}"
61-
# commercial repo is always the OSS repo with -commercial appended
62-
COMMERCIAL_REPO="${OSS_REPO}-commercial"
63-
echo "commercial_repo=${COMMERCIAL_REPO}" >> "$GITHUB_OUTPUT"
64-
echo "commercial_branch=${OSS_BRANCH}" >> "$GITHUB_OUTPUT"
65-
echo "OSS repo: $OSS_REPO"
66-
echo "OSS branch: $OSS_BRANCH"
67-
echo "Commercial repo: $COMMERCIAL_REPO"
68-
echo "Commercial branch: $OSS_BRANCH"
69-
7048
initialize:
71-
needs: derive
7249
uses: ./.github/workflows/initialize-commercial-branch.yml
7350
with:
74-
oss_repo: ${{ inputs.oss_repo }}
75-
oss_branch: ${{ inputs.oss_branch }}
76-
commercial_repo: ${{ needs.derive.outputs.commercial_repo }}
77-
commercial_branch: ${{ needs.derive.outputs.commercial_branch }}
51+
oss_repo: ${{ inputs.oss_repo }}
52+
oss_branch: ${{ inputs.oss_branch }}
53+
commercial_repo: ${{ format('{0}-commercial', inputs.oss_repo) }}
54+
commercial_branch: ${{ inputs.oss_branch }}
7855
set_default_branch: ${{ inputs.set_default_branch }}
79-
secrets:
80-
token: ${{ secrets.token || secrets.GH_ACTIONS_REPO_TOKEN }}
56+
secrets: inherit

.github/workflows/create-hotfix-branch.yml

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -37,38 +37,12 @@ permissions:
3737
contents: read
3838

3939
jobs:
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

Comments
 (0)