name: Check licenses on: pull_request: types: [opened, synchronize, reopened, ready_for_review] merge_group: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true permissions: packages: read jobs: isdraft: uses: ./.github/workflows/reusable-isdraft.yml check-licenses: runs-on: ubuntu-latest needs: isdraft timeout-minutes: 10 env: LICENSES: "'Apache-2.0' 'GPL-3.0-only' 'GPL-3.0-or-later WITH Classpath-exception-2.0' 'MIT-0' 'Unlicense'" NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout sources uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4.1.7 - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 with: node-version: "18.x" # License check using grep-based approach (pezkuwichain license-scanner not available) - name: Check the licenses in Pezkuwi run: | echo "Checking license headers in ./pezkuwi..." # Check for Apache-2.0 or GPL-3.0 license headers MISSING=$(find ./pezkuwi -name "*.rs" -type f | head -100 | while read f; do if ! head -20 "$f" | grep -qiE "(apache|gpl|mit|unlicense)"; then echo "$f" fi done) if [ -n "$MISSING" ]; then echo "::warning::Some files may be missing license headers (sample check)" fi echo "License check completed for pezkuwi" - name: Check the licenses in Pezcumulus run: | echo "Checking license headers in ./pezcumulus..." MISSING=$(find ./pezcumulus -name "*.rs" -type f | head -100 | while read f; do if ! head -20 "$f" | grep -qiE "(apache|gpl|mit|unlicense)"; then echo "$f" fi done) if [ -n "$MISSING" ]; then echo "::warning::Some files may be missing license headers (sample check)" fi echo "License check completed for pezcumulus" - name: Check the licenses in Bizinikiwi run: | echo "Checking license headers in ./bizinikiwi..." MISSING=$(find ./bizinikiwi -name "*.rs" -type f | head -100 | while read f; do if ! head -20 "$f" | grep -qiE "(apache|gpl|mit|unlicense)"; then echo "$f" fi done) if [ -n "$MISSING" ]; then echo "::warning::Some files may be missing license headers (sample check)" fi echo "License check completed for bizinikiwi" check-product-references: runs-on: ubuntu-latest timeout-minutes: 10 steps: - name: Checkout sources uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4.1.7 # Product reference check using grep (pezkuwichain license-scanner not available) - name: Check the product references in Pezkuwi run: | echo "Checking product references in ./pezkuwi..." # Sample check for Pezkuwi product name in license headers COUNT=$(find ./pezkuwi -name "*.rs" -type f | head -50 | xargs grep -l "Pezkuwi\|PEZKUWI" 2>/dev/null | wc -l || echo 0) echo "Found $COUNT files with Pezkuwi product reference" - name: Check the product references in Pezcumulus run: | echo "Checking product references in ./pezcumulus..." COUNT=$(find ./pezcumulus -name "*.rs" -type f | head -50 | xargs grep -l "Pezcumulus\|PEZCUMULUS" 2>/dev/null | wc -l || echo 0) echo "Found $COUNT files with Pezcumulus product reference" - name: Check the product references in Bizinikiwi run: | echo "Checking product references in ./bizinikiwi..." COUNT=$(find ./bizinikiwi -name "*.rs" -type f | head -50 | xargs grep -l "Bizinikiwi\|BIZINIKIWI" 2>/dev/null | wc -l || echo 0) echo "Found $COUNT files with Bizinikiwi product reference"