Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trigger lint #1

Merged
merged 8 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/helm-lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Helm Lint

on:
Expand All @@ -14,26 +15,27 @@ on:

jobs:
helm-check:
runs-on: ubuntu:latest
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:

- name: Install packages
run: |
apt update
apt install -y git unzip
sudo apt update
sudo apt install -y git unzip

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/checkout@master
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.10.1
uses: azure/[email protected]

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@8238a4103220c636f2dad328ead8a7c8dbe316a3 # v39.2.0
uses: tj-actions/changed-files@main
with:
files: |
apps/**
Expand All @@ -51,18 +53,17 @@ jobs:
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
chart=$(echo $file | cut -d/ -f 1-2)
values_dir="$chart/values"

# Check and lint values in the 'values' directories
if [[ -d "$values_dir" ]]; then
for value_file in $(find "$values_dir" -type f); do
echo "helm lint $chart -f $value_file"
helm lint "$chart" -f "$value_file"
done
fi
# Fallback to lint the chart without specific value files if none of the directories exist
# Fallback to lint the chart without specific value
# files if none of the directories exist
if [[ ! -d "$values_dir" ]]; then
helm lint "$chart"
fi
done

shell: bash
12 changes: 8 additions & 4 deletions .github/workflows/json-lint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: JSON Lint

on:
Expand All @@ -13,21 +14,24 @@ on:

jobs:
json-check:
runs-on: ubuntu:latest
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/checkout@master
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@8238a4103220c636f2dad328ead8a7c8dbe316a3 # v39.2.0
uses: tj-actions/changed-files@main
with:
files: |
apps/**/values/**

- name: JSON lint
uses: dungpham91/lint-json-inside-yaml@ee76a68fafcf4b959e711e24d11d9c4f33137e80 # v0.0.2
uses: dungpham91/lint-json-inside-yaml@main
with:
folder_or_file: ${{ steps.changed-files.outputs.all_changed_files }}
20 changes: 12 additions & 8 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
---
name: Yaml Lint

on:
pull_request:
branches:
- main
paths:
- .github/**
- environments/**
- '.github/**'
- 'environments/**'
types:
- opened
- reopened
- synchronize

jobs:
yaml-check:
runs-on: ubuntu:latest
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:

- name: Install packages
run: |
apt update
apt install -y git
apt install -y yamllint
sudo apt update
sudo apt install -y git
sudo apt install -y yamllint

- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/checkout@master
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@8238a4103220c636f2dad328ead8a7c8dbe316a3 # v39.2.0
uses: tj-actions/changed-files@main
with:
files: |
.github/**
Expand Down
6 changes: 1 addition & 5 deletions apps/iptoolkits/values/dev.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Default values for iptoolkits.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
Expand Down Expand Up @@ -98,4 +94,4 @@ config:
PORT: "3000"

reloader:
enabled: true
enabled: true