From 38eb1d05f1515c92ed2cd0192bd3acfbcd875c2d Mon Sep 17 00:00:00 2001 From: a-thomas-22 <112640918+a-thomas-22@users.noreply.github.com> Date: Sat, 27 Jan 2024 16:42:29 -0600 Subject: [PATCH] Modify github actions for dev base branch --- .github/workflows/generate-chart-readme.yaml | 1 + .github/workflows/lint.yaml | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-chart-readme.yaml b/.github/workflows/generate-chart-readme.yaml index 84c78f4..4dab0bf 100644 --- a/.github/workflows/generate-chart-readme.yaml +++ b/.github/workflows/generate-chart-readme.yaml @@ -4,6 +4,7 @@ on: pull_request: branches: - main + - dev permissions: {} # Remove all permissions by default diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 6896ad0..c490c4c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -4,6 +4,7 @@ on: pull_request: branches: - main + - dev jobs: lint-test: @@ -30,11 +31,17 @@ jobs: - name: Run chart-testing (list-changed) id: list-changed run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config ct.yaml) + changed=$(ct list-changed --target-branch ${{ github.base_ref }} --config ct.yaml) if [[ -n "$changed" ]]; then echo "changed=true" >> "$GITHUB_OUTPUT" fi - name: Run chart-testing (lint) if: steps.list-changed.outputs.changed == 'true' - run: ct lint --target-branch ${{ github.event.repository.default_branch }} --lint-conf lintconf.yaml --config ct.yaml + run: | + ARGS="--target-branch ${{ github.base_ref }} --lint-conf lintconf.yaml --config ct.yaml" + # Add an additional argument if the base branch is 'dev' + if [ "${{ github.base_ref }}" == "dev" ]; then + ARGS="$ARGS --check-version-increment false" + fi + ct lint $ARGS