From ad02b16a5b0a8541d73aa00f2bc959e59addf7af Mon Sep 17 00:00:00 2001 From: Evan Johnson Date: Thu, 15 Feb 2024 11:06:34 -0500 Subject: [PATCH] restrict helm releases to be triggered by Github releases --- .github/workflows/helm.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml index 554bd13d..17df884e 100644 --- a/.github/workflows/helm.yml +++ b/.github/workflows/helm.yml @@ -1,15 +1,11 @@ name: Helm on: - push: - branches: - - main - paths: - - 'deploy/chart/**' pull_request: paths: - 'deploy/chart/**' workflow_dispatch: {} + release: {} permissions: contents: read @@ -26,8 +22,8 @@ jobs: - name: Set Version run: | TAG=$(git describe --tags --abbrev=0) - sed -ie "s/appVersion: \"latest\"/appVersion: ${TAG}/g" deploy/chart/Chart.yaml - sed -ie "s/version: 0.0.0/version: ${TAG}/g" deploy/chart/Chart.yaml + sed -ie "s/appVersion: \"latest\"/appVersion: ${TAG#helm-}/g" deploy/chart/Chart.yaml + sed -ie "s/version: 0.0.0/version: ${TAG#helm-}/g" deploy/chart/Chart.yaml - name: Set up Helm uses: azure/setup-helm@v3 @@ -65,8 +61,8 @@ jobs: - name: Set Version run: | TAG=$(git describe --tags --abbrev=0) - sed -ie "s/appVersion: \"latest\"/appVersion: ${TAG}/g" deploy/chart/Chart.yaml - sed -ie "s/version: 0.0.0/version: ${TAG}/g" deploy/chart/Chart.yaml + sed -ie "s/appVersion: \"latest\"/appVersion: ${TAG#helm-}/g" deploy/chart/Chart.yaml + sed -ie "s/version: 0.0.0/version: ${TAG#helm-}/g" deploy/chart/Chart.yaml - name: Configure Git run: | @@ -80,8 +76,7 @@ jobs: uses: helm/chart-releaser-action@v1.6.0 env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - CR_RELEASE_NAME_TEMPLATE: "{{ .Version }}" + CR_RELEASE_NAME_TEMPLATE: "helm-{{ .Version }}" with: charts_dir: deploy skip_existing: true - packages_with_index: true