Skip to content

Commit e39d26b

Browse files
authored
Merge pull request #146 from Deltares/sonarqube
sonarqube errors
2 parents ff357b9 + ac268d1 commit e39d26b

4 files changed

Lines changed: 21 additions & 7 deletions

File tree

.github/workflows/bump_version.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ on:
1212
jobs:
1313
bump-up-version:
1414
if: github.event.pull_request.merged == true
15-
secrets: inherit
15+
secrets:
16+
SECRET: ${{secrets.VERSION_DECOIMPACT}}
1617
uses: ./.github/workflows/version_upgrade.yml
1718
with:
1819
release_type: patch

.github/workflows/mkdocs_documentation.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
jobs:
1111
create-docs:
1212
runs-on: ubuntu-latest
13+
env:
14+
if: ${{ lower(inputs.project_version) == upper(inputs.project_version) }}
15+
env:
16+
VERSION: ${{ inputs.project_version }}
17+
1318
steps:
1419
- name: checkout code
1520
uses: actions/checkout@v4
@@ -30,5 +35,5 @@ jobs:
3035
run: |
3136
git config user.name github-actions
3237
git config user.email github-actions@github.com
33-
poetry run mike deploy --push --update-aliases ${{ inputs.project_version }} latest
34-
poetry run mike set-default --push latest
38+
poetry run mike deploy --push --update-aliases "$VERSION" latest
39+
poetry run mike set-default --push latest

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ on:
1616

1717
jobs:
1818
bump-up-version:
19-
secrets: inherit
19+
secrets:
20+
SECRET: ${{secrets.VERSION_DECOIMPACT}}
2021
uses: ./.github/workflows/version_upgrade.yml
2122
with:
2223
release_type: ${{ github.event.inputs.release_type }}
@@ -37,13 +38,16 @@ jobs:
3738

3839
create-documentation:
3940
needs: bump-up-version
40-
secrets: inherit
41+
secrets:
42+
SECRET: ${{secrets.VERSION_DECOIMPACT}}
4143
uses: ./.github/workflows/mkdocs_documentation.yml
4244
with:
4345
project_version: ${{ needs.bump-up-version.outputs.project_version }}
4446

4547
docker-build:
4648
needs: bump-up-version
4749
uses: ./.github/workflows/docker_image.yml
50+
secrets:
51+
SECRET: ${{ secrets.GITHUB_TOKEN }}
4852
with:
4953
project_version: ${{ needs.bump-up-version.outputs.project_version }}

.github/workflows/version_upgrade.yml

Lines changed: 6 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,9 @@ on:
1819
jobs:
1920
upgrade-version:
2021
runs-on: ubuntu-latest
22+
env:
23+
# check if the input is valid, if not set it to empty string, if valid it will be used in the poetry version command
24+
RELEASE_TYPE: ${{ (inputs.release_type == 'major' || inputs.release_type == 'minor' || inputs.release_type == 'patch') && inputs.release_type || '' }}
2125
outputs:
2226
job_output_version: ${{ steps.get-version.outputs.PROJECT_VERSION}}
2327
steps:
@@ -39,7 +43,7 @@ jobs:
3943
run: |
4044
git config user.name github-actions
4145
git config user.email github-actions@github.com
42-
poetry version ${{ inputs.release_type }}
46+
poetry version "$RELEASE_TYPE"
4347
PROJECT_VERSION=$(poetry version --short)
4448
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_OUTPUT
4549
sed -i "1 s/.*/version: $PROJECT_VERSION/" template_input.yaml
@@ -48,5 +52,5 @@ jobs:
4852
PROJECT_VERSION=$(poetry version --short)
4953
git add template_input.yaml
5054
git add pyproject.toml
51-
git commit -m "bump ${{ inputs.release_type }} version: ${{ steps.get-version.outputs.PROJECT_VERSION }}"
55+
git commit -m "bump "$RELEASE_TYPE" version: ${{ steps.get-version.outputs.PROJECT_VERSION }}"
5256
git push

0 commit comments

Comments
 (0)