@@ -37,28 +37,31 @@ jobs:
37
37
- name : Set up chart-testing
38
38
39
39
40
- - name : Run chart-testing (list-changed)
41
- id : list-changed
40
+ - name : Determine target branch
41
+ id : ct-branch-target
42
42
run : |
43
43
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}
46
45
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/}
49
47
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}})
50
53
if [[ -n "$changed" ]]; then
51
54
echo "::set-output name=changed::true"
52
55
fi
53
56
54
57
- 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 }}
56
59
if : steps.list-changed.outputs.changed == 'true'
57
60
58
61
- name : Create kind cluster
59
62
60
63
if : steps.list-changed.outputs.changed == 'true'
61
64
62
65
- 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 }}
64
67
if : steps.list-changed.outputs.changed == 'true'
0 commit comments