add missing audit type #5310
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: Check If Repository Application Is Installed | |
| on: | |
| pull_request: | |
| types: | |
| - edited | |
| - opened | |
| - synchronize | |
| jobs: | |
| check-repo-installation: | |
| runs-on: ubuntu-latest | |
| env: | |
| BACKEND_URL: https://api.allocator.tech | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v3 | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@v46 | |
| with: | |
| files: 'Allocators/**/*.json' | |
| - name: Check allocator bookkeeping URLs | |
| if: ${{ steps.changed-files.outputs.any_changed == 'true' }} | |
| run: | | |
| failed=0 | |
| failures="" | |
| invalid_files="" | |
| for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
| echo "" | |
| echo "🔍 Processing $file" | |
| repo_url=$(jq -r '.application.allocation_bookkeeping // empty' "$file") | |
| if [[ "$repo_url" == https://github.com/* ]]; then | |
| owner=$(echo "$repo_url" | cut -d'/' -f4) | |
| repo=$(echo "$repo_url" | cut -d'/' -f5) | |
| echo "Found GitHub repo: $owner/$repo" | |
| echo "Checking installation status..." | |
| if curl -f -X GET "${BACKEND_URL}/allocator/check_if_repository_application_is_installed?owner=$owner&repo=$repo"; then | |
| : | |
| else | |
| echo "" | |
| echo "::error file=$file,title=Repository Check Failed::Repository check failed for $owner/$repo" | |
| failures="${failures}\n- $owner/$repo (from $file)" | |
| failed=1 | |
| fi | |
| else | |
| echo "" | |
| echo "::warning file=$file,title=Invalid allocation_bookkeeping::Missing or invalid GitHub URL in $file" | |
| invalid_files="${invalid_files}\n- $file" | |
| fi | |
| done | |
| if [[ "$failed" -eq 1 ]]; then | |
| echo "" | |
| echo -e "Repository checks failed:\n$failures" | |
| exit 1 | |
| fi | |
| if [[ -n "$invalid_files" ]]; then | |
| echo "" | |
| echo -e "::warning title=Invalid or Missing GitHub URLs::The following files have missing or invalid allocation_bookkeeping GitHub URLs:\n$invalid_files" | |
| exit 1 | |
| fi | |
| echo "" | |
| echo "All repository checks passed." | |
| - name: No relevant JSON files found | |
| if: ${{ steps.changed-files.outputs.any_changed == 'false' }} | |
| run: echo "No changed JSON files in Allocators/ — nothing to check." |