Skip to content

Commit 31c9602

Browse files
authored
Fixed n-1 patch release (dell#71)
1 parent cb46011 commit 31c9602

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/release.yaml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,40 @@ on: # yamllint disable-line rule:truthy
1414
- major
1515
- minor
1616
- patch
17+
- n-1/n-2 patch (Provide input in the below box)
18+
version:
19+
description: "Patch version to release. example: 2.1.x (Use this only if n-1/n-2 patch is selected)"
20+
required: false
21+
type: string
1722
repository_dispatch:
1823
types: [release-go-libs]
1924
jobs:
25+
process-inputs:
26+
name: Process Inputs
27+
runs-on: ubuntu-latest
28+
outputs:
29+
processedVersion: ${{ steps.set-version.outputs.versionEnv }}
30+
steps:
31+
- name: Process input
32+
id: set-version
33+
shell: bash
34+
run: |
35+
if [[ "${{ github.event.inputs.version }}" != "" && "${{ github.event.inputs.option }}" == "n-1/n-2 patch (Provide input in the below box)" ]]; then
36+
# if both version and option are provided, then version takes precedence i.e. patch release for n-1/n-2
37+
echo "versionEnv=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
38+
exit 0
39+
fi
40+
if [[ "${{ github.event.inputs.option }}" != "n-1/n-2 patch (Provide input in the below box)" ]]; then
41+
# if only option is provided, then option takes precedence i.e. minor, major or patch release
42+
echo "versionEnv=${{ github.event.inputs.option }}" >> $GITHUB_OUTPUT
43+
exit 0
44+
fi
45+
# if neither option nor version is provided, then minor release is taken by default (Auto-release)
46+
echo "versionEnv=minor" >> $GITHUB_OUTPUT
2047
csm-release:
48+
needs: [process-inputs]
2149
uses: dell/common-github-actions/.github/workflows/csm-release-libs.yaml@main
2250
name: Release Go Client Libraries
2351
with:
24-
version: "${{ github.event.inputs.option || 'minor' }}"
52+
version: ${{ needs.process-inputs.outputs.processedVersion }}
2553
secrets: inherit

0 commit comments

Comments
 (0)