Merge pull request #55 from kartoza/lindie #4
This file contains hidden or 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
| name: 🗜️ Yaml Checks | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main, master] | |
| jobs: | |
| yamllint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: pip install yamllint | |
| - run: yamllint . | |
| yamlfmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install yamlfmt | |
| run: sudo snap install yamlfmt | |
| - name: Run yamlfmt | |
| run: | | |
| find . -name '*.yaml' -o -name '*.yml' | while read -r f; do | |
| # Skip empty files | |
| if [ ! -s "$f" ]; then | |
| echo "🦘 Skipping empty file: $f" | |
| continue | |
| fi | |
| # Skip files with only whitespace/comments | |
| if ! grep -q '[^[:space:]#]' "$f"; then | |
| echo "🦘 Skipping file containing only whitespace or comments: $f" | |
| continue | |
| fi | |
| echo "⚒️ Formatting yaml file: $f" | |
| yamlfmt "$f" | |
| done |