Open
Conversation
e76ba52 to
6c83778
Compare
6c83778 to
03ba23c
Compare
03ba23c to
9c844a7
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modernizes the license compliance workflow by moving license generation from development time to build time. License information is now generated as a goreleaser pre-build hook for each platform and embedded into the binary via go:embed, making it accessible through a new gh licenses command. This eliminates the need to commit platform-specific license files to the repository and removes the requirement to run make licenses after every dependency update.
Changes:
- Removed all committed third-party license files and reports from the repository
- Modified
script/licensesto support both single-platform generation and verification modes - Added goreleaser pre-build hooks to generate licenses for each build target
- Introduced new
gh licensescommand to display embedded license information
Reviewed changes
Copilot reviewed 207 out of 207 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| third-party/*/LICENSE | Removed all committed third-party license files |
| script/licenses-check | Removed standalone license check script |
| script/licenses | Refactored to support both build-time generation and CI verification |
| pkg/cmd/root/root.go | Added licenses command to root command |
| pkg/cmd/licenses/licenses.go | New command to display embedded license information |
| internal/licenses/licenses.go | Core logic for embedding and formatting license content |
| internal/licenses/licenses_test.go | Unit tests for license content generation |
| internal/licenses/embed/* | Placeholder files for embedded license data |
| docs/license-compliance.md | Updated documentation for new workflow |
| Makefile | Updated license targets to use new script interface |
| .goreleaser.yml | Added pre-build hooks to generate licenses |
| .github/workflows/lint.yml | Updated CI to verify license generation |
| .github/secret_scanning.yml | Removed exclusions for deleted license files |
| .github/licenses.tmpl | Simplified template for embedded report |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
We currently handle our license compliance by producing reports, and including licenses and NOTICES in our source code. We have a script that does this per
GOOSbut we started experiencing issues whenGOARCHdifferences could result in failures on CI not noticed locally. We made an attempt to provide a matrix of these options but it gets pretty annoying. We'd also need to keep it updated as release targets change.Separately, we also have this issue where every dependabot PR requires
make licenseswhich is super annoying. This PR moves all of that to build time as a goreleaser hook, which already hasGOOSandGOARCH, and then the results are bundled in the binary viaembedand made available viagh licenses.I don't think we have any obligation to solve for other people building/distributing an artifact, so the default embed has some help text.
Reviewer Notes
You can run
./script/release --local --platform <platform>to build under./distand usegh licensesto check the output.You can also get a staging release from here: https://github.com/cli/cli/actions/runs/21755383986
It maybe adds about 1MB to the size of the binary, seems fast enough to run
gh licenses