Skip to content

Commit

Permalink
feat: Add ci script from PR #176
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-bisonai committed Feb 12, 2024
1 parent e99ac40 commit 9541e82
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.helm-lint.yaml
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

0 comments on commit 9541e82

Please sign in to comment.