Added support for latest when creating release branches

- this should allow us to run the job without any manual effort, because
  it'll choose the latest tag for the patch release
This commit is contained in:
Daniel Lockyer 2022-09-06 15:39:10 +01:00
parent cbccd400c6
commit e80ab4fc46
No known key found for this signature in database
GPG Key ID: D21186F0B47295AD

View File

@ -3,11 +3,12 @@ on:
workflow_dispatch:
inputs:
base-ref:
description: 'Git ref to base from'
description: 'Git ref to base from (defaults to latest tag)'
type: string
default: 'latest'
required: false
bump-type:
description: ''
description: 'Version bump type (patch, minor)'
type: string
required: false
default: 'patch'
@ -19,9 +20,15 @@ jobs:
create-branch:
runs-on: ubuntu-latest
steps:
- run: echo "BASE_REF=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
if: inputs.base-ref == 'latest'
- run: echo "BASE_REF=${{ inputs.base-ref }}" >> $GITHUB_ENV
if: inputs.base-ref != 'latest'
- uses: actions/checkout@v3
with:
ref: ${{ inputs.base-ref }}
ref: ${{ env.BASE_REF }}
fetch-depth: 0
submodules: true