Skip to content

Add hotfix workflow

Add hotfix workflow #2

name: Create Hotfix Branch

Check failure on line 1 in .github/workflows/create-hotfix-branch.yml

View workflow run for this annotation

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

Invalid workflow file

(Line: 46, Col: 27): Unrecognized function: 'replace'. Located at position 17 within expression: format('{0}.x', replace(inputs.oss_tag, 'v', ''))
# Creates a commercial hotfix branch from an OSS tag.
#
# The commercial repo is always the OSS repo with -commercial appended.
# The commercial branch name is derived from the tag by stripping the leading
# 'v' and appending '.x' (e.g. v5.0.1 -> 5.0.1.x).
on:
workflow_dispatch:
inputs:
oss_repo:
description: 'Open source repository (format: org/repo-name)'
required: true
type: string
oss_tag:
description: 'OSS tag to create the hotfix branch from (e.g. v5.0.1)'
required: true
type: string
workflow_call:
inputs:
oss_repo:
description: 'Open source repository (format: org/repo-name)'
required: true
type: string
oss_tag:
description: 'OSS tag to create the hotfix branch from (e.g. v5.0.1)'
required: true
type: string
secrets:
token:
description: 'GitHub token with contents: write on the commercial repo. Falls back to the GH_ACTIONS_REPO_TOKEN organization secret.'
required: false
permissions:
contents: read
jobs:
initialize:
uses: ./.github/workflows/initialize-commercial-branch.yml
with:
oss_repo: ${{ inputs.oss_repo }}
oss_tag: ${{ inputs.oss_tag }}
commercial_repo: ${{ format('{0}-commercial', inputs.oss_repo) }}
commercial_branch: ${{ format('{0}.x', replace(inputs.oss_tag, 'v', '')) }}
set_default_branch: false
secrets: inherit