Skip to content

Commit

Permalink
restrict helm releases to be triggered by Github releases
Browse files Browse the repository at this point in the history
  • Loading branch information
eljohnson92 committed Feb 15, 2024
1 parent 4fb6241 commit ad02b16
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
name: Helm

on:
push:
branches:
- main
paths:
- 'deploy/chart/**'
pull_request:
paths:
- 'deploy/chart/**'
workflow_dispatch: {}
release: {}

permissions:
contents: read
Expand All @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -80,8 +76,7 @@ jobs:
uses: helm/[email protected]
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

0 comments on commit ad02b16

Please sign in to comment.