fix: install the repo's Go version and surface license scanner failures - #180
Merged
Conversation
The licenses setup action pins Go 1.23. In repos whose go.mod requires a newer Go, the go command downloads that toolchain into the module cache, where go-licenses cannot identify standard-library packages and every `go-licenses report` invocation dies with "Package <std> does not have module info". Install the Go version from go.mod instead (latest stable when there is no go.mod), so GOROOT is a regular installation. These failures went unnoticed because both scripts mask exit codes: `licenses` pipes list-licenses into the engine, so only the engine's status counts, and list-licenses hides xargs failures behind a grep. Run both scripts with pipefail so any failing stage fails the check. Co-Authored-By: Claude Fable 5 (1M context) <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
adamwalach
approved these changes
Aug 19, 2026
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.
Problem
Every push to ory/cli master since 2026-06-12 fails the Licenses workflow (example run), and license checking has silently covered only 3 of ~34 Go dependencies since even longer (ory/cli's committed
dep-licenses.csvhas been stale since 2025-08-05).Two causes:
licenses/setuppins Go 1.23. In repos whosego.modrequires a newer Go, the go command downloads that toolchain into the module cache and GOROOT points there. Under a module-cache GOROOT, go-licenses cannot identify standard-library packages, and everygo-licenses reportinvocation dies withPackage <std> does not have module info. This became fatal with fix: resolve licenses for versioned modules and module-only roots #175, which switchedlist-licensesto per-packagego-licenses reportcalls (before that, a few module-root invocations happened to short-circuit and keep the job green while reporting almost nothing).licensespipeslist-licensesinto the engine, so only the engine's exit status counts, andlist-licenseshides xargs failures behind a trailing grep. That's why the "Check licenses" step stayed green on PRs while the same scanner crashed — only the write step on master pushes (which redirects to a file) surfaced the failure.Fix
licenses/setup/action.yml: install the Go version fromgo.mod(go-version-file, same pattern asdocs/cli-next), falling back tostablewhen there is nogo.mod, so GOROOT is a regular installation.licenses/licenses,licenses/list-licenses: run with bashpipefailso any failing stage fails the check, and invokego-licensesdirectly viabin_dirinstead of a CWD-relativesh -cwrapper.Verification
make test(shellcheck + shfmt) passes.list-licensesexits 0 and reports 179 license lines (vs. 7 stale ones today), and the full list passeslicense-engine.sh— so ory/cli CI goes green after this merges, no new allowlist entries needed.GOTOOLCHAIN=go1.26.0): the current check script exits 0 (silent pass), the fixed one exits 1 with the go-licenses errors visible.Follow-up after merge
licenses/installpinsORY_CI_REF=747531bforcurl | shconsumers (e.g.make licensesin downstream repos). GitHub Actions consumers pick this fix up immediately viaORY_CI_ROOT, but the pin needs bumping to this PR's merge commit in a follow-up, as done after #178.🤖 Generated with Claude Code