Skip to content

RHDHPAI-29: Add yaml formatting validation (#41) #1

RHDHPAI-29: Add yaml formatting validation (#41)

RHDHPAI-29: Add yaml formatting validation (#41) #1

Workflow file for this run

name: CI
# Triggers the workflow on push or pull request events but only for the main branch
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
yaml-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: skip checking conditional syntax
working-directory: ./templates
run: |
find . -regextype egrep -regex '.*ya?ml$'|while read file; do
sed -i 's/: \s*['\''"]\{0\}\([^'\''"]*{{.*}}.*\)\s*$/: '\''\1'\''/' $file
sed -i '/^\(\s*\)\({%-.*\)$/d' $file
done
- name: yaml format
run: |
curl -L -O https://github.com/google/yamlfmt/releases/download/v0.15.0/yamlfmt_0.15.0_Linux_x86_64.tar.gz
tar -xf yamlfmt_0.15.0_Linux_x86_64.tar.gz
chmod +x yamlfmt
./yamlfmt -lint