Skip to content

Add CI job to verify all Rust files have license headers #1826

Add CI job to verify all Rust files have license headers

Add CI job to verify all Rust files have license headers #1826

Workflow file for this run

name: Label Checker
on:
pull_request:
branches: main
types: [opened, labeled, unlabeled, synchronize, reopened]
permissions:
pull-requests: read
contents: read
jobs:
check-labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Ensure exactly one "kind/*" label is applied
run: |
# Count the number of "kind/*" labels using GitHub API via github.event
LABELS=$(echo '${{ toJSON(github.event.pull_request.labels) }}' | jq -r '.[].name')
KIND_LABEL_COUNT=$(echo "$LABELS" | grep -c "^kind/" || true)
if [[ "$KIND_LABEL_COUNT" -eq 1 ]]; then
echo "✅ Exactly one 'kind/*' label is applied."
exit 0
else
echo "❌ PR must have exactly one 'kind/*' label, but found $KIND_LABEL_COUNT."
exit 1
fi