testing #152
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: Validate GitHub Org Configuration | |
on: | |
pull_request: | |
paths: | |
- "config.yaml" | |
# Declare default permissions as read only. | |
permissions: read-all | |
jobs: | |
config-validated: | |
runs-on: ubuntu-latest | |
name: config-validated | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Lowercase and sort config.yaml key and values | |
uses: mikefarah/yq@bc5b54cb1d1f720db16c9f75c5b45384d00e5cbf # v4.44.5 | |
with: | |
cmd: yq -i e '(... | select(type == "!!seq"))[] |= downcase' config.yaml && yq -i e '(... | select(type == "!!seq")) |= sort' config.yaml && yq -i 'sort_keys(..)' config.yaml | |
- name: Check if there are changes to config.yaml | |
id: changes | |
run: echo "changed=$(git status --porcelain config.yaml | wc -l)" >> $GITHUB_OUTPUT | |
- name: Fail if config.yaml changes found | |
if: steps.changes.outputs.changed >= 1 | |
run: | | |
echo "Uncommitted changes to config.yaml exist. Failing." | |
echo | |
git status --porcelain | |
git --no-pager diff config.yaml | |
exit 1 |