Skip to content

fix canary routemap template #401

fix canary routemap template

fix canary routemap template #401

Workflow file for this run

name: Lint Helm charts
# Only runs when charts have changed
# Lint Helm charts
on:
pull_request:
branches:
- master
paths:
- charts/**
jobs:
# Get the paths for the Helm charts to lint
get_paths:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get the paths for Helm charts to lint
id: set-matrix
run: |
# Get paths (in string form)
stringPaths=$(find -maxdepth 2 -path './charts/*')
# Check paths (length greater than 0)
stringPathsLength=$(echo ${#stringPaths})
if (( stringPathsLength == 0 ));
then
echo "No paths to check"
exit 1
fi
# Serialize paths into JSON array
paths=$(jq -ncR '[inputs]' <<< "$stringPaths")
# Output serialized paths
echo "matrix=$paths" >> $GITHUB_OUTPUT
echo $paths
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
# Lint Helm charts based on paths provided by previous job
lint:
name: Test changed-files
needs: get_paths
runs-on: ubuntu-latest
strategy:
matrix:
version: ${{ fromJson(needs.get_paths.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get modified files in the ${{ matrix.version }} folder
id: modified-files
uses: tj-actions/changed-files@v35
with:
files: ${{ matrix.version }}
- name: Lint Helm charts in the ${{ matrix.version }} folder
uses: stackrox/kube-linter-action@v1
if: steps.modified-files.outputs.any_modified == 'true'
with:
directory: ${{ matrix.version }}