Add validation and README #2
Workflow file for this run
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
name: normalize | |
on: | |
push: | |
paths: | |
- '*.yaml' | |
pull_request: | |
paths: | |
- '*.yaml' | |
workflow_dispatch: | |
jobs: | |
normalize: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3' | |
bundler-cache: true | |
working-directory: ./scripts | |
- name: Normalize YAML files | |
working-directory: ./scripts | |
run: | | |
for file in ../*.yaml; do | |
bundle exec unitsdb-utils normalize "$file" "$file" | |
done | |
- name: Check for changes | |
id: changes | |
run: | | |
if [[ -n "$(git status --porcelain)" ]]; then | |
echo "changes=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Create Pull Request | |
if: steps.changes.outputs.changes == 'true' | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
commit-message: 'chore: normalize YAML files' | |
title: 'Normalize YAML files' | |
body: 'This PR normalizes YAML files by sorting keys and applying consistent formatting.' | |
branch: normalize-yaml | |
delete-branch: true |