Skip to content

Commit bea0f43

Browse files
authored
main(helm): chart linting - specify target branch for all ct (DefectDojo#4412)
Missed some stuff, testing in my fork (probably not all cases, but good enough I'd say). Against master for immediate effect
1 parent 915b82b commit bea0f43

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

.github/workflows/test-helm-chart.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,31 @@ jobs:
3737
- name: Set up chart-testing
3838
uses: helm/[email protected]
3939

40-
- name: Run chart-testing (list-changed)
41-
id: list-changed
40+
- name: Determine target branch
41+
id: ct-branch-target
4242
run: |
4343
if [ ! -z ${GITHUB_BASE_REF} ]; then
44-
echo "pull_request: ct list-changed --config ct.yaml --target-branch ${GITHUB_BASE_REF}"
45-
changed=$(ct list-changed --config ct.yaml --target-branch ${GITHUB_BASE_REF})
44+
echo ::set-output name=ct-branch::${GITHUB_BASE_REF}
4645
else
47-
echo "push: ct list-changed --config ct.yaml --target-branch ${GITHUB_REF#refs/heads/}"
48-
changed=$(ct list-changed --config ct.yaml --target-branch ${GITHUB_REF#refs/heads/})
46+
echo ::set-output name=ct-branch::${GITHUB_REF#refs/heads/}
4947
fi
48+
49+
- name: Run chart-testing (list-changed)
50+
id: list-changed
51+
run: |
52+
changed=$(ct list-changed --config ct.yaml --target-branch ${{ steps.ct-branch-target.outputs.ct-branch}})
5053
if [[ -n "$changed" ]]; then
5154
echo "::set-output name=changed::true"
5255
fi
5356
5457
- name: Run chart-testing (lint)
55-
run: ct lint --config ct.yaml
58+
run: ct lint --config ct.yaml --target-branch ${{ steps.ct-branch-target.outputs.ct-branch }}
5659
if: steps.list-changed.outputs.changed == 'true'
5760

5861
- name: Create kind cluster
5962
uses: helm/[email protected]
6063
if: steps.list-changed.outputs.changed == 'true'
6164

6265
- name: Run chart-testing (install)
63-
run: ct install
66+
run: ct install --config ct.yaml --target-branch ${{ steps.ct-branch-target.outputs.ct-branch }}
6467
if: steps.list-changed.outputs.changed == 'true'

0 commit comments

Comments
 (0)