From dfebc62cd21ecee4c27c9d8b3e64de76c73e2e7e Mon Sep 17 00:00:00 2001 From: Kamyar Rafati Date: Tue, 20 Dec 2022 12:17:24 +0100 Subject: [PATCH 1/4] fix: helm chart action parameters --- .github/actions/push-helm-chart/action.yml | 16 +++++++++++++--- .github/workflows/maven-docker-release.yml | 6 +++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/actions/push-helm-chart/action.yml b/.github/actions/push-helm-chart/action.yml index 6748c24..b955009 100644 --- a/.github/actions/push-helm-chart/action.yml +++ b/.github/actions/push-helm-chart/action.yml @@ -1,7 +1,17 @@ name: 'Push Helm Chart' description: Create and push Helm Chart to Repository if helm folder exists +inputs: + repository: + description: 'Github repository name' + required: true + token: + description: 'Github Token to access repository' + required: true + username: + description: 'Github Username to access repository' + required: true env: - GCR_IMAGE: oci://ghcr.io/${{ github.repository }} + GCR_IMAGE: oci://ghcr.io/${{ inputs.repository }} runs: using: "composite" steps: @@ -20,8 +30,8 @@ runs: with: useOCIRegistry: true registry-url: ${{ steps.lower-repo.outputs.repository }} - access-token: ${{ secrets.GITHUB_TOKEN }} - username: ${{ github.actor }} + access-token: ${{ inputs.token }} + username: ${{ inputs.username }} force: true chart-folder: helm add-repositories: true \ No newline at end of file diff --git a/.github/workflows/maven-docker-release.yml b/.github/workflows/maven-docker-release.yml index e6b6703..bceece4 100644 --- a/.github/workflows/maven-docker-release.yml +++ b/.github/workflows/maven-docker-release.yml @@ -87,7 +87,11 @@ jobs: run: mvn package -Dmaven.test.skip.exec=true -P docker-image -Djib.to.image=${REGISTRY}/backbase/${GITHUB_REPOSITORY##*/}:${{ inputs.version }} - name: Create & Push Helm Chart - uses: backbase/workflows/.github/actions/push-helm-chart@v0.1.0 + uses: backbase/workflows/.github/actions/push-helm-chart@main + with: + repository: ${{ github.repository }} + username: ${{ github.actor }} + token: ${{ secrets.github-token }} - name: Configure Maven uses: backbase/workflows/.github/actions/maven-bump@v0.1.0 From 69d1c87d9cb5e642ccfc1b46492b8c3f5dc394d3 Mon Sep 17 00:00:00 2001 From: Kamyar Rafati Date: Tue, 20 Dec 2022 12:56:31 +0100 Subject: [PATCH 2/4] fix: helm chart action parameters --- .github/actions/push-helm-chart/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/push-helm-chart/action.yml b/.github/actions/push-helm-chart/action.yml index b955009..25df9a2 100644 --- a/.github/actions/push-helm-chart/action.yml +++ b/.github/actions/push-helm-chart/action.yml @@ -10,8 +10,6 @@ inputs: username: description: 'Github Username to access repository' required: true -env: - GCR_IMAGE: oci://ghcr.io/${{ inputs.repository }} runs: using: "composite" steps: @@ -20,6 +18,10 @@ runs: uses: andstor/file-existence-action@v2 with: files: "helm/values.yml" + - name: set repo url + shell: bash + run: | + echo "GCR_IMAGE=oci://ghcr.io/${{ inputs.repository }}" >> $GITHUB_ENV - id: lower-repo shell: pwsh run: | From d3659c1e21f51552df6d39c4f73eb85d087ab1dc Mon Sep 17 00:00:00 2001 From: Kamyar Rafati Date: Tue, 20 Dec 2022 12:17:24 +0100 Subject: [PATCH 3/4] fix: helm chart action parameters --- .github/actions/push-helm-chart/action.yml | 16 +++++++++++++--- .github/workflows/maven-docker-release.yml | 4 ++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/actions/push-helm-chart/action.yml b/.github/actions/push-helm-chart/action.yml index 6748c24..b955009 100644 --- a/.github/actions/push-helm-chart/action.yml +++ b/.github/actions/push-helm-chart/action.yml @@ -1,7 +1,17 @@ name: 'Push Helm Chart' description: Create and push Helm Chart to Repository if helm folder exists +inputs: + repository: + description: 'Github repository name' + required: true + token: + description: 'Github Token to access repository' + required: true + username: + description: 'Github Username to access repository' + required: true env: - GCR_IMAGE: oci://ghcr.io/${{ github.repository }} + GCR_IMAGE: oci://ghcr.io/${{ inputs.repository }} runs: using: "composite" steps: @@ -20,8 +30,8 @@ runs: with: useOCIRegistry: true registry-url: ${{ steps.lower-repo.outputs.repository }} - access-token: ${{ secrets.GITHUB_TOKEN }} - username: ${{ github.actor }} + access-token: ${{ inputs.token }} + username: ${{ inputs.username }} force: true chart-folder: helm add-repositories: true \ No newline at end of file diff --git a/.github/workflows/maven-docker-release.yml b/.github/workflows/maven-docker-release.yml index e2af917..bceece4 100644 --- a/.github/workflows/maven-docker-release.yml +++ b/.github/workflows/maven-docker-release.yml @@ -88,6 +88,10 @@ jobs: - name: Create & Push Helm Chart uses: backbase/workflows/.github/actions/push-helm-chart@main + with: + repository: ${{ github.repository }} + username: ${{ github.actor }} + token: ${{ secrets.github-token }} - name: Configure Maven uses: backbase/workflows/.github/actions/maven-bump@v0.1.0 From d5f55fde259b613d8aa9bd047f97b2ca07843fe7 Mon Sep 17 00:00:00 2001 From: Kamyar Rafati Date: Tue, 20 Dec 2022 12:56:31 +0100 Subject: [PATCH 4/4] fix: helm chart action parameters --- .github/actions/push-helm-chart/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/push-helm-chart/action.yml b/.github/actions/push-helm-chart/action.yml index b955009..25df9a2 100644 --- a/.github/actions/push-helm-chart/action.yml +++ b/.github/actions/push-helm-chart/action.yml @@ -10,8 +10,6 @@ inputs: username: description: 'Github Username to access repository' required: true -env: - GCR_IMAGE: oci://ghcr.io/${{ inputs.repository }} runs: using: "composite" steps: @@ -20,6 +18,10 @@ runs: uses: andstor/file-existence-action@v2 with: files: "helm/values.yml" + - name: set repo url + shell: bash + run: | + echo "GCR_IMAGE=oci://ghcr.io/${{ inputs.repository }}" >> $GITHUB_ENV - id: lower-repo shell: pwsh run: |