diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abbb6e0c2..132e17793 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,3 +28,13 @@ jobs: env: # see https://lychee.cli.rs/troubleshooting/rate-limits/#github-rate-limiting GITHUB_TOKEN: ${{ github.token }} + + license-check: + runs-on: ubuntu-slim + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Run license-check + run: make license-check diff --git a/Makefile b/Makefile index fee1d51b9..47bd351ec 100644 --- a/Makefile +++ b/Makefile @@ -28,3 +28,13 @@ markdown-link-check: --root-dir /home/repo \ --verbose \ home/repo + +.PHONY: license-check +license-check: + @licRes=$$(for f in $$(find . -type f \( -iname '*.py' -o -iname '*.sh' \) ! -path '**/third_party/*' ! -path './.git/*' ) ; do \ + awk '/Copyright The OpenTelemetry Authors|generated|GENERATED/ && NR<=4 { found=1; next } END { if (!found) print FILENAME }' $$f; \ + done); \ + if [ -n "$${licRes}" ]; then \ + echo "license header checking failed:"; echo "$${licRes}"; \ + exit 1; \ + fi diff --git a/scripts/baremetal-runner-report.py b/scripts/baremetal-runner-report.py index 481f452ed..945da5d72 100644 --- a/scripts/baremetal-runner-report.py +++ b/scripts/baremetal-runner-report.py @@ -1,4 +1,7 @@ #!/usr/bin/env python3 +# +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 """ Bare-metal benchmark runner usage report. diff --git a/scripts/gc-elections/convert-voter-roll-to-helios.py b/scripts/gc-elections/convert-voter-roll-to-helios.py index a031c510c..7df210dee 100644 --- a/scripts/gc-elections/convert-voter-roll-to-helios.py +++ b/scripts/gc-elections/convert-voter-roll-to-helios.py @@ -1,3 +1,8 @@ +#!/usr/bin/env python3 +# +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +# import csv import os diff --git a/scripts/gc-elections/create-github-comments.py b/scripts/gc-elections/create-github-comments.py index 1461059fd..b1435b0d8 100644 --- a/scripts/gc-elections/create-github-comments.py +++ b/scripts/gc-elections/create-github-comments.py @@ -1,3 +1,8 @@ +#!/usr/bin/env python3 +# +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +# """Tag eligible voters on a GitHub issue for the OpenTelemetry GC election. Behaviour: diff --git a/scripts/gc-elections/generate-voters-roll.py b/scripts/gc-elections/generate-voters-roll.py index 145e79bb5..0832753b4 100644 --- a/scripts/gc-elections/generate-voters-roll.py +++ b/scripts/gc-elections/generate-voters-roll.py @@ -1,3 +1,8 @@ +#!/usr/bin/env python3 +# +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +# import csv import datetime import os diff --git a/scripts/move-to-emeritus.py b/scripts/move-to-emeritus.py index c14b995fc..b7c5402b3 100644 --- a/scripts/move-to-emeritus.py +++ b/scripts/move-to-emeritus.py @@ -1,20 +1,25 @@ #!/usr/bin/env python3 -# Usage: -# # Check all repos and print report -# python move-to-emeritus.py # -# # Check all repos with debug output (shows why each member was marked active/inactive) -# python move-to-emeritus.py --debug -# -# # Check only specific repo(s) -# python move-to-emeritus.py --repo opentelemetry-collector -# python move-to-emeritus.py --repo opentelemetry-collector opentelemetry-python -# -# # Create PRs to move inactive members to emeritus (after verifying the report) -# python move-to-emeritus.py --create-prs -# -# Note: the script can be safely re-run multiple times. If a PR already exists for a repo, its body will be updated with the latest info. +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 # +""" +Usage: + # Check all repos and print report + python move-to-emeritus.py + + # Check all repos with debug output (shows why each member was marked active/inactive) + python move-to-emeritus.py --debug + + # Check only specific repo(s) + python move-to-emeritus.py --repo opentelemetry-collector + python move-to-emeritus.py --repo opentelemetry-collector opentelemetry-python + + # Create PRs to move inactive members to emeritus (after verifying the report) + python move-to-emeritus.py --create-prs + +Note: the script can be safely re-run multiple times. If a PR already exists for a repo, its body will be updated with the latest info. +""" import argparse import base64 import json diff --git a/scripts/update-community-members.py b/scripts/update-community-members.py index 07e65a5d4..ac3c6d4f7 100755 --- a/scripts/update-community-members.py +++ b/scripts/update-community-members.py @@ -1,4 +1,8 @@ #!/usr/bin/env python3 +# +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +# import subprocess import sys diff --git a/scripts/update-sig-tables.py b/scripts/update-sig-tables.py index 6a5dcb5c3..29949eb1f 100755 --- a/scripts/update-sig-tables.py +++ b/scripts/update-sig-tables.py @@ -1,4 +1,7 @@ #!/usr/bin/env python3 +# +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 import re import subprocess import sys diff --git a/scripts/validate-workstreams.py b/scripts/validate-workstreams.py index d8d6bea7d..437cb20b3 100644 --- a/scripts/validate-workstreams.py +++ b/scripts/validate-workstreams.py @@ -1,4 +1,8 @@ #!/usr/bin/env python3 +# +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +# """ Validates workstreams.yml.