Merge pull request #35 from CityOfNewOrleans/CaseUpdates #161
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 XML/XSD Files | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install XML tools | |
run: sudo apt-get update -y && sudo apt-get install libxml2-utils -y | |
- name: Find and validate XML/XSD files | |
run: | | |
set -e | |
find . -type f \( -iname "*.xml" -o -iname "*.xsd" \) | while read file; do | |
echo "Validating $file..." | |
xmllint --noout "$file" | |
if [ $? -eq 0 ]; then | |
echo "$file is valid." | |
else | |
echo "$file is not a valid XML or XSD file. Please check your syntax." | |
exit 1 | |
fi | |
done |