cli/docs/license-compliance.md
Andy Feller bd24865076 Adopt license compliance scripts into workflows, docs
This commit introduces the use of `go-licenses` within CI/CD and manual processes for generating / updating the license information used by GitHub CLI including the code required by license to be redistributed.

During GitHub CLI pull requests, the `lint` workflow will notify users if this information is not updated.
2025-05-30 12:46:51 -04:00

1.7 KiB

License Compliance

GitHub CLI complies with the software licenses of its dependencies. This document explains how license compliance is maintained.

Overview

When a dependency is added or updated, the license information needs to be updated. We use the google/go-licenses tool to:

  1. Generate markdown documentation listing all Go dependencies and their licenses
  2. Copy license files for dependencies that require redistribution

License Files

The following files contain license information:

  • third-party-licenses.darwin.md - License information for macOS dependencies
  • third-party-licenses.linux.md - License information for Linux dependencies
  • third-party-licenses.windows.md - License information for Windows dependencies
  • third-party/ - Directory containing source code and license files that require redistribution

Updating License Information

When dependencies change, you need to update the license information:

  1. Update license information for all platforms:

    script/licenses
    
  2. Commit the changes:

    git add third-party-licenses.*.md third-party/
    git commit -m "Update third-party license information"
    

Checking License Compliance

The CI workflow checks if license information is up to date. To check locally:

script/licenses-check

If the check fails, follow the instructions to update the license information.

How It Works

  • script/licenses - Script to generate license information for all platforms or a specific platform
  • script/licenses-check - Script to check if license information is up to date
  • .github/workflows/lint.yml - CI workflow that includes license compliance checking