mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 17:07:04 +02:00
ci: 🧠
This commit is contained in:
parent
0802eed93e
commit
6fd154cb99
3 changed files with 31 additions and 22 deletions
29
.github/workflows/charts-lint.yaml
vendored
29
.github/workflows/charts-lint.yaml
vendored
|
@ -9,6 +9,9 @@ on:
|
|||
chartChangesDetected:
|
||||
required: true
|
||||
type: string
|
||||
chartChanges:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
|
@ -34,20 +37,20 @@ jobs:
|
|||
- name: Set up chart-testing
|
||||
uses: helm/chart-testing-action@v2.2.1
|
||||
|
||||
- name: Collect changes
|
||||
id: list-changed
|
||||
if: inputs.chartChangesDetected == 'true'
|
||||
run: |
|
||||
EXCLUDED=$(yq eval -o=json '.excluded-charts // []' .ci/ct/ct-lint.yaml)
|
||||
CHARTS=$(ct list-changed --config .ci/ct/ct-lint.yaml)
|
||||
CHARTS_JSON=$(echo "${CHARTS}" | jq -R -s -c 'split("\n")[:-1]')
|
||||
OUTPUT_JSON=$(echo "{\"excluded\": ${EXCLUDED}, \"all\": ${CHARTS_JSON}}" | jq -c '.all-.excluded')
|
||||
echo ::set-output name=charts::${OUTPUT_JSON}
|
||||
if [[ $(echo ${OUTPUT_JSON} | jq -c '. | length') -gt 0 ]]; then
|
||||
echo "::set-output name=detected::true"
|
||||
fi
|
||||
# - name: Collect changes
|
||||
# id: list-changed
|
||||
# if: inputs.chartChangesDetected == 'true'
|
||||
# run: |
|
||||
# EXCLUDED=$(yq eval -o=json '.excluded-charts // []' .ci/ct/ct-lint.yaml)
|
||||
# CHARTS=$(ct list-changed --config .ci/ct/ct-lint.yaml)
|
||||
# CHARTS_JSON=$(echo "${CHARTS}" | jq -R -s -c 'split("\n")[:-1]')
|
||||
# OUTPUT_JSON=$(echo "{\"excluded\": ${EXCLUDED}, \"all\": ${CHARTS_JSON}}" | jq -c '.all-.excluded')
|
||||
# echo ::set-output name=charts::${OUTPUT_JSON}
|
||||
# if [[ $(echo ${OUTPUT_JSON} | jq -c '. | length') -gt 0 ]]; then
|
||||
# echo "::set-output name=detected::true"
|
||||
# fi
|
||||
|
||||
- name: Run chart-testing (lint)
|
||||
id: lint
|
||||
if: steps.list-changed.outputs.detected == 'true'
|
||||
if: inputs.chartChanges != ''
|
||||
run: ct lint --config .ci/ct/ct-lint.yaml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue