From a95ef9f3db755bc26ef9f4ce525c1b2918514af7 Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Tue, 21 Feb 2023 20:27:38 +0100 Subject: [PATCH 1/4] Use github.base_ref for target-branch Signed-off-by: Marco Franssen --- .github/workflows/helm-chart-ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/helm-chart-ci.yaml b/.github/workflows/helm-chart-ci.yaml index 72ee2c0..223cc89 100644 --- a/.github/workflows/helm-chart-ci.yaml +++ b/.github/workflows/helm-chart-ci.yaml @@ -57,7 +57,7 @@ jobs: - name: Run chart-testing (list-changed) id: list-changed run: | - changed=$(ct list-changed --target-branch main) + changed=$(ct list-changed --target-branch ${{ github.base_ref }}) if [[ -n "$changed" ]]; then echo "changed=true" >> $GITHUB_OUTPUT fi @@ -65,7 +65,7 @@ jobs: - name: Run chart-testing (lint) run: | ct lint --debug \ - --target-branch main + --target-branch ${{ github.base_ref }} outputs: changed: ${{ steps.list-changed.outputs.changed }} @@ -150,7 +150,7 @@ jobs: - name: Run chart-testing (install) run: | ct install --debug \ - --target-branch main \ + --target-branch ${{ github.base_ref }} \ --exclude-deprecated \ ${{ (matrix.values != 'default' && '--helm-extra-set-args "--values=.github/tests/$VALUES/values.yaml"') || '' }} env: From 3c7d828954301f98b2360846271ebbaaabe9c38f Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Tue, 21 Feb 2023 19:42:59 +0100 Subject: [PATCH 2/4] Only check for version bump if PR targets main Signed-off-by: Marco Franssen --- .github/workflows/helm-chart-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-chart-ci.yaml b/.github/workflows/helm-chart-ci.yaml index 223cc89..13df35d 100644 --- a/.github/workflows/helm-chart-ci.yaml +++ b/.github/workflows/helm-chart-ci.yaml @@ -64,7 +64,7 @@ jobs: - name: Run chart-testing (lint) run: | - ct lint --debug \ + ct lint --debug ${{ github.base_ref != 'main' && '--check-version-increment=false' || '' }} \ --target-branch ${{ github.base_ref }} outputs: From e8768ec955629babff8a1d1088dd7920e17cf8c6 Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Tue, 21 Feb 2023 20:02:00 +0100 Subject: [PATCH 3/4] Add types to trigger workflow when changing the target branch Signed-off-by: Marco Franssen --- .github/workflows/helm-chart-ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/helm-chart-ci.yaml b/.github/workflows/helm-chart-ci.yaml index 13df35d..76bae0d 100644 --- a/.github/workflows/helm-chart-ci.yaml +++ b/.github/workflows/helm-chart-ci.yaml @@ -3,6 +3,7 @@ name: Helm Chart CI on: workflow_dispatch: pull_request: + types: [synchronize, opened, reopened, edited] paths: - 'charts/**' - '.github/workflows/helm-chart-ci.yaml' From a29df4f6ccaeb7ab45afb36c7504eab2e2a22be6 Mon Sep 17 00:00:00 2001 From: Marco Franssen Date: Wed, 22 Feb 2023 12:42:43 +0100 Subject: [PATCH 4/4] Change to cut releases from the release branch Signed-off-by: Marco Franssen --- .github/workflows/helm-chart-ci.yaml | 2 +- .github/workflows/helm-release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-chart-ci.yaml b/.github/workflows/helm-chart-ci.yaml index 76bae0d..6736e48 100644 --- a/.github/workflows/helm-chart-ci.yaml +++ b/.github/workflows/helm-chart-ci.yaml @@ -65,7 +65,7 @@ jobs: - name: Run chart-testing (lint) run: | - ct lint --debug ${{ github.base_ref != 'main' && '--check-version-increment=false' || '' }} \ + ct lint --debug ${{ github.base_ref != 'release' && '--check-version-increment=false' || '' }} \ --target-branch ${{ github.base_ref }} outputs: diff --git a/.github/workflows/helm-release.yaml b/.github/workflows/helm-release.yaml index b60e2fc..fd703c4 100644 --- a/.github/workflows/helm-release.yaml +++ b/.github/workflows/helm-release.yaml @@ -3,7 +3,7 @@ name: Release Helm Charts on: push: branches: - - main + - release paths: - '.github/workflows/helm-release.yml' - 'charts/**'