mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-01-24 07:59:02 +00:00
a101402e74
Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: "Charts: Lint"
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
checkoutCommit:
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint charts
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ inputs.checkoutCommit }}
|
|
|
|
- name: Install Helm
|
|
uses: azure/setup-helm@v1
|
|
with:
|
|
version: v3.6.3
|
|
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.7
|
|
|
|
- name: Set up chart-testing
|
|
uses: helm/chart-testing-action@v2.1.0
|
|
|
|
- name: Collect changes
|
|
id: list-changed
|
|
run: |
|
|
EXCLUDED=$(yq eval -o=json '.excluded-charts // []' .github/ct-lint.yaml)
|
|
CHARTS=$(ct list-changed --config .github/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'
|
|
run: ct lint --config .github/ct-lint.yaml
|