Skip to content

Commit 3a4d8e8

Browse files
committed
sonarqube: validate release_type
1 parent ff357b9 commit 3a4d8e8

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/version_upgrade.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
inputs:
1010
release_type:
1111
required: true
12+
description: Choose type of release
1213
type: string
1314
outputs:
1415
project_version:
@@ -18,6 +19,8 @@ on:
1819
jobs:
1920
upgrade-version:
2021
runs-on: ubuntu-latest
22+
env:
23+
RELEASE_TYPE: ${{ inputs.release_type == 'major' && 'major' || 'minor' }}
2124
outputs:
2225
job_output_version: ${{ steps.get-version.outputs.PROJECT_VERSION}}
2326
steps:
@@ -39,7 +42,7 @@ jobs:
3942
run: |
4043
git config user.name github-actions
4144
git config user.email github-actions@github.com
42-
poetry version ${{ inputs.release_type }}
45+
poetry version "$RELEASE_TYPE"
4346
PROJECT_VERSION=$(poetry version --short)
4447
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_OUTPUT
4548
sed -i "1 s/.*/version: $PROJECT_VERSION/" template_input.yaml
@@ -48,5 +51,5 @@ jobs:
4851
PROJECT_VERSION=$(poetry version --short)
4952
git add template_input.yaml
5053
git add pyproject.toml
51-
git commit -m "bump ${{ inputs.release_type }} version: ${{ steps.get-version.outputs.PROJECT_VERSION }}"
54+
git commit -m "bump "$RELEASE_TYPE" version: ${{ steps.get-version.outputs.PROJECT_VERSION }}"
5255
git push

0 commit comments

Comments
 (0)