ci: validate profiles #1
Workflow file for this run
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: Validate Profiles | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build profiles archive | |
| run: bash make_profiles_archive.sh profiles.zip | |
| - name: Validate profiles | |
| run: | | |
| response=$(curl -sf -w "\n%{http_code}" \ | |
| -X POST https://api.enapter.com/v3/blueprints/device_profiles/validate \ | |
| -H "Content-Type: application/zip" \ | |
| --data-binary @profiles.zip) | |
| body=$(echo "$response" | head -n -1) | |
| status=$(echo "$response" | tail -n 1) | |
| echo "$body" | |
| if [ "$status" -lt 200 ] || [ "$status" -ge 300 ]; then | |
| echo "Validation failed with HTTP $status" | |
| exit 1 | |
| fi |