From 961b72825f37896f817f5c3e0d0a4c11bfc70628 Mon Sep 17 00:00:00 2001 From: David Collom Date: Thu, 22 Aug 2024 15:38:20 +0100 Subject: [PATCH] Fix up chart publishing --- .github/workflows/build-helm-chart.yaml | 30 ----------------------- .github/workflows/publish-helm-chart.yaml | 5 ++-- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build-helm-chart.yaml b/.github/workflows/build-helm-chart.yaml index 5f3f7a5..49fe98a 100644 --- a/.github/workflows/build-helm-chart.yaml +++ b/.github/workflows/build-helm-chart.yaml @@ -72,33 +72,3 @@ jobs: # Ensure that the chart's default values produce manifests - run: helm template test . - - - if: ${{inputs.publish}} - name: checkout jetstack-charts - uses: actions/checkout@v4 - with: - token: ${{ secrets.JETSTACK_CHARTS_PAT }} - repository: jetstack/jetstack-charts - ref: main - path: jetstack-charts - - - if: ${{inputs.publish}} - name: Package helm chart - working-directory: ./${{inputs.chart-name}}/chart/ - run: | - helm package . -d jetstack-charts/charts/ - - - name: Creating PR - if: ${{inputs.publish}} - uses: peter-evans/create-pull-request@v6.1.0 - with: - token: ${{ secrets.JETSTACK_CHARTS_PAT }} - title: "Release ${{inputs.chart-name}} ${{github.ref_name }}" - commit-message: "Release ${{inputs.chart-name}} ${{github.ref_name }}" - branch: ${{inputs.chart-name}}/${{github.ref_name}} - path: jetstack-charts - add-paths: charts/*.tgz - delete-branch: true - signoff: true - base: main - draft: false diff --git a/.github/workflows/publish-helm-chart.yaml b/.github/workflows/publish-helm-chart.yaml index f3cc0ad..7a75dd6 100644 --- a/.github/workflows/publish-helm-chart.yaml +++ b/.github/workflows/publish-helm-chart.yaml @@ -2,7 +2,6 @@ name: Publish Chart on: workflow_dispatch: # Enable manual generation - pull_request: push: tags: - "v*" @@ -86,7 +85,9 @@ jobs: run: | helm package . -d ${{github.workspace}}/jetstack-charts/charts/ - - name: Creating PR + # Only create the PR when we're triggered by a tag + - if: contains(github.ref, 'refs/tags/') + name: Creating PR uses: peter-evans/create-pull-request@v6.1.0 with: token: ${{ secrets.JETSTACK_CHARTS_PAT }}