Some checks failed
renovate / renovate (push) Has been cancelled
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://github.com/actions/checkout) | action | major | `v4` -> `v5` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v5`](https://github.com/actions/checkout/compare/v4...v5) [Compare Source](https://github.com/actions/checkout/compare/v4...v5) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTUuNCIsInVwZGF0ZWRJblZlciI6IjQxLjE1NS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: #1937 Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net> Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
83 lines
2.4 KiB
YAML
83 lines
2.4 KiB
YAML
name: lint-test-helm
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'clusters/**'
|
|
- ! 'clusters/*/archive'
|
|
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'clusters/**'
|
|
- ! 'clusters/*/archive'
|
|
|
|
jobs:
|
|
helm-lint:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Check Branch Exists
|
|
id: check-branch-exists
|
|
uses: GuillaumeFalourd/branch-exists@v1.1
|
|
with:
|
|
branch: "origin/${{ github.base_ref }}"
|
|
|
|
- name: Branch Does Not Exist
|
|
if: steps.check-branch-exists.outputs.exists == 'false'
|
|
run: echo "Branch origin/${{ github.base_ref }} was not found, likely already merged"
|
|
|
|
- name: Set up Helm
|
|
if: steps.check-branch-exists.outputs.exists == 'true'
|
|
uses: azure/setup-helm@v4
|
|
with:
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
version: latest
|
|
|
|
- name: Lint Helm Chart
|
|
if: steps.check-branch-exists.outputs.exists == 'true'
|
|
run: |
|
|
set -e # Exit immediately if a command exits with a non-zero status.
|
|
|
|
TARGET_BRANCH="origin/${{ github.base_ref }}"
|
|
echo ">> Target branch for diff is: $TARGET_BRANCH"
|
|
|
|
CHANGED_FILES=$(git diff --name-only "$TARGET_BRANCH" -- 'clusters/**')
|
|
|
|
echo ">> Found changed files:"
|
|
echo "$CHANGED_FILES"
|
|
|
|
# For each changed file, find its parent chart directory (the one with Chart.yaml).
|
|
# Then, create a unique list of those directories.
|
|
CHANGED_CHARTS=$(echo "$CHANGED_FILES" | while read -r file; do
|
|
dir=$(dirname "$file")
|
|
while [[ "$dir" != "." && ! -f "$dir/Chart.yaml" ]]; do
|
|
dir=$(dirname "$dir")
|
|
done
|
|
if [[ "$dir" != "." ]]; then
|
|
echo "$dir"
|
|
fi
|
|
done | sort -u)
|
|
|
|
if [[ -z "$CHANGED_CHARTS" ]]; then
|
|
echo ">> Could not determine changed charts. This could happen if only files outside a chart were changed."
|
|
exit 0
|
|
fi
|
|
|
|
echo ">> Running helm lint on changed charts:"
|
|
echo "$CHANGED_CHARTS"
|
|
|
|
echo "$CHANGED_CHARTS" | while read -r chart; do
|
|
echo ">> Building dependency for "$chart" ..."
|
|
helm dependency build "$chart"
|
|
echo ">> Linting $chart..."
|
|
helm lint "$chart"
|
|
done
|