-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jay-bisonai
committed
Feb 12, 2024
1 parent
e99ac40
commit 9541e82
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: CI Helm Lint | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
- opened | ||
branches: | ||
- main | ||
- gcp-cypress-prod | ||
- gcp-baobab-prod | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run Helm lint | ||
uses: WyriHaximus/github-action-helm3@v3 | ||
id: lint | ||
with: | ||
exec: | | ||
failed_services="" | ||
for file in $(git diff --name-only HEAD~1..HEAD); do | ||
dir=$(dirname $file) | ||
if [ -f "$dir/Chart.yaml" ]; then | ||
if ! helm lint $dir; then | ||
failed_services+="'$(basename $dir)', " | ||
fi | ||
fi | ||
done | ||
if [ -n "$failed_services" ]; then | ||
# Remove the trailing comma and space | ||
failed_services=${failed_services%??} | ||
echo "failed_services=$failed_services" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Failed services | ||
if: steps.lint.outputs.failed_services | ||
run: | | ||
echo "Failed services: ${{ steps.lint.outputs.failed_services }}" | ||
exit 1 |