Skip to content

Release ~ Release patch version #10

Release ~ Release patch version

Release ~ Release patch version #10

# (C) 2024 GoodData Corporation
name: Release ~ Release patch version
on:
workflow_dispatch:
inputs:
version:
required: true
description: "Specify the minor version to patch (example: 9.5.0)"
type: string
jobs:
check-input-version-param:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.check-input-version-param.outputs.branch }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check branch for version exists
id: check-input-version-param
run: |
base="rel/${VERSION%.*}"
if git ls-remote --heads origin ${base} | grep ${base}; then
echo "Branch ${base} exists for version ${VERSION}"
echo "branch=${base}" >> $GITHUB_OUTPUT
else
echo "Branch ${base} does not exist for release ${VERSION} on remote, aborting release"
exit 1
fi
env:
VERSION: ${{ inputs.version }}
gate-approval:
needs: check-input-version-param
runs-on: ubuntu-latest
environment:
name: production
steps:
- run: echo "Initiating approval"
publish-release-npm:
needs: [gate-approval, check-input-version-param]
uses: ./.github/workflows/rw-perform-release-patch.yml
permissions:
pull-requests: write
contents: write
id-token: write
secrets: inherit
with:
source-branch: ${{needs.check-input-version-param.outputs.branch}}