releasing 1.4.3 [rebase & merge]
#147
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 License Headers | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: license-check-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| check-headers: | |
| name: Validate License Headers | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📥 Checkout the repository | |
| uses: actions/checkout@v4 | |
| - name: 🔍 Check license headers | |
| run: | | |
| FAILED_FILES=() | |
| # Apache 2.0 RF-DETR header pattern (first 5 lines) | |
| APACHE_HEADER="# ------------------------------------------------------------------------ | |
| # RF-DETR | |
| # Copyright (c) 2025 Roboflow. All Rights Reserved. | |
| # Licensed under the Apache License, Version 2.0 [see LICENSE for details] | |
| # ------------------------------------------------------------------------" | |
| # Platform Model License 1.0 header pattern (first 2 identifying lines) | |
| PML_LINE1="# Platform Model License 1.0 (PML-1.0)" | |
| PML_LINE2="# Copyright (c) 2026 Roboflow, Inc. All Rights Reserved." | |
| while IFS= read -r -d '' file; do | |
| # Read first 15 lines of the file | |
| HEADER=$(head -n 15 "$file") | |
| # Check for Apache 2.0 RF-DETR header | |
| if echo "$HEADER" | grep -q "# RF-DETR" && \ | |
| echo "$HEADER" | grep -q "# Copyright (c) 2025 Roboflow. All Rights Reserved." && \ | |
| echo "$HEADER" | grep -q "# Licensed under the Apache License, Version 2.0"; then | |
| continue | |
| fi | |
| # Check for Platform Model License 1.0 header | |
| if echo "$HEADER" | grep -q "$PML_LINE1" && \ | |
| echo "$HEADER" | grep -q "$PML_LINE2"; then | |
| continue | |
| fi | |
| # File doesn't have a valid header | |
| FAILED_FILES+=("$file") | |
| done < <(find . -name "*.py" -type f ! -path "./.venv/*" ! -path "./venv/*" ! -path "./.git/*" -print0) | |
| if [ ${#FAILED_FILES[@]} -gt 0 ]; then | |
| echo "❌ The following files are missing valid license headers:" | |
| echo "" | |
| for file in "${FAILED_FILES[@]}"; do | |
| echo " - $file" | |
| done | |
| echo "" | |
| echo "Each Python file must start with one of the following headers:" | |
| echo "" | |
| echo "1. Apache 2.0 (RF-DETR):" | |
| echo " # ------------------------------------------------------------------------" | |
| echo " # RF-DETR" | |
| echo " # Copyright (c) 2025 Roboflow. All Rights Reserved." | |
| echo " # Licensed under the Apache License, Version 2.0 [see LICENSE for details]" | |
| echo " # ------------------------------------------------------------------------" | |
| echo "" | |
| echo "2. Platform Model License 1.0:" | |
| echo " # ------------------------------------------------------------------------" | |
| echo " # Platform Model License 1.0 (PML-1.0)" | |
| echo " # Copyright (c) 2026 Roboflow, Inc. All Rights Reserved." | |
| echo " # ..." | |
| echo " # ------------------------------------------------------------------------" | |
| exit 1 | |
| fi | |
| echo "✅ All Python files have valid license headers." |