Skip to content

Replace custom license-check with GitHub dependency-review-action - #1690

Merged
Erik Osterman (Cloud Posse) (osterman) merged 19 commits into
mainfrom
osterman/go-license-check
Oct 21, 2025
Merged

Erik Osterman (Cloud Posse) (osterman) merged 19 commits into
mainfrom
osterman/go-license-check

Conversation

@osterman

@osterman Erik Osterman (Cloud Posse) (osterman) commented Oct 21, 2025 •

Copy link
Copy Markdown
Member

what

  • Replaced custom license-check action (308 lines) with GitHub's native dependency-review-action
  • Simplified workflow from 44 lines to 18 lines with better functionality
  • Added automated NOTICE file generation and validation to CI
  • Workflow now:
    • Validates licenses using GitHub's dependency graph
    • Blocks PRs with forbidden licenses (GPL, AGPL, etc.)
    • Generates NOTICE file using go-licenses
    • Fails CI if NOTICE file is out of date

why

  • Reduce maintenance burden: GitHub's native action requires zero maintenance vs custom bash fighting go-licenses bugs
  • Better reliability: Native GitHub solution works across all ecosystems, not just Go
  • Automated NOTICE updates: Ensures NOTICE file stays in sync with dependencies automatically
  • Clearer error messages: Developers get actionable feedback when NOTICE file needs updating
  • Industry standard: Uses same tooling as thousands of other repositories

references


Troubleshooting Notes

autofix.ci Artifact Upload Errors (RESOLVED)

Error encountered:

Attempt 4 of 5 failed with error: Unexpected token 'O', "Original A"... is not valid JSON
Error: Failed to CreateArtifact: Failed to make request after 5 attempts

Root Cause:
When using RunsOn self-hosted runners with extras=s3-cache, the runs-on/action@v2 step is required for artifact uploads to work. Without it, the artifact API receives HTML error pages instead of JSON responses.

Fix Applied:

  1. Added runs-on/action@v2 as first step in autofix.yml (required for S3 cache compatibility)
  2. Added permissions: { contents: read, actions: write } (was empty {} which grants NO permissions)
  3. Upgraded autofix-ci/action from v1.3.1 to v1.3.2

Reference:

  • RunsOn S3 Cache Documentation
  • Key quote: "If you have enabled the s3-cache extra and are using the actions/upload-artifact@v4 action in your workflows, you must ensure that you have also included the runs-on/action@v2 action in your jobs."

Time saved for future developers: ~2 hours of debugging 🎯

Summary by CodeRabbit

  • New Features

    • Added automatic dependency license review to flag restricted licenses (GPL, LGPL, AGPL) on pull requests.
    • Added vulnerability severity checks to the dependency review process.
    • Introduced comprehensive NOTICE file documenting all third-party dependencies and their licenses.
  • Documentation

    • Added documentation for license generation utilities and scripts.

@github-actions github-actions Bot added the size/xl Extra large size PR label Oct 21, 2025
@coderabbitai

coderabbitai Bot commented Oct 21, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Replaces a removed license-check workflow with automated NOTICE generation and a new dependency-review workflow; adds a scripts/generate-notice.sh script and documentation; updates the autofix workflow to run NOTICE generation and adjusts workflow permissions.

Changes

Cohort / File(s) Summary
License check workflow removal
​.github/workflows/license-check.yml
Removed the previous "License Check" GitHub Actions workflow and all its steps (Go setup, go-licenses install, scripts/check-licenses.sh, report generation and artifact upload).
NOTICE file and documentation
NOTICE, scripts/README.md
Added a comprehensive NOTICE enumerating third-party dependencies and scripts/README.md documenting the generate-notice script, usage, CI integration, and troubleshooting.
NOTICE generation script
scripts/generate-notice.sh
Added a Bash script that ensures go-licenses, generates a license report, parses and categorizes dependencies by license type, and writes/updates the NOTICE file with counts and sections.
Autofix workflow enhancement
​.github/workflows/autofix.yml
Updated top-level and job-level permissions (contents: read, actions: write); added a "Generate NOTICE file" step running ./scripts/generate-notice.sh; updated autofix action version and added runs-on/action@v2 usage.
New dependency review workflow
​.github/workflows/dependency-review.yml
Added a "Dependency Review" workflow that runs on PRs, runs actions/dependency-review-action with a denied-license list and vulnerability gating, runs ./scripts/generate-notice.sh, and fails if NOTICE is not up to date.

Sequence Diagram(s)

sequenceDiagram
    participant PR as Pull Request
    participant DepReview as Dependency Review Workflow
    participant Checkout as actions/checkout
    participant SetupGo as actions/setup-go
    participant DepAction as dependency-review-action
    participant Script as generate-notice.sh
    participant GoLic as go-licenses
    participant Repo as Repository (NOTICE)
    PR->>DepReview: trigger (opened/synchronize/reopened)
    DepReview->>Checkout: checkout code
    DepReview->>SetupGo: setup Go (from go.mod)
    DepReview->>DepAction: run dependency review (deny list, vuln checks)
    alt denied license or vuln found
        DepAction->>PR: fail & comment
    else pass
        DepReview->>Script: run ./scripts/generate-notice.sh
        Script->>GoLic: ensure installed / run report
        GoLic-->>Script: license report
        Script->>Script: parse & categorize licenses
        Script->>Repo: write/update NOTICE
        DepReview->>Repo: git diff NOTICE
        alt NOTICE changed
            DepReview->>PR: fail (NOTICE out of date)
        else
            DepReview->>PR: pass
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • aknysh

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Replace custom license-check with GitHub dependency-review-action" is concise, specific, and clearly describes the primary architectural change of this pull request. The title directly maps to the main objective: replacing the custom license-check implementation with GitHub's native dependency-review-action. While the PR also introduces NOTICE file generation and updates CI workflows, the most important change from a developer's perspective is the tool replacement, which the title accurately captures. The title uses clear, descriptive language without vague terms, emojis, or noise, making it immediately understandable to someone scanning the project's history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch osterman/go-license-check

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a2709e0 and 9e529e5.

📒 Files selected for processing (2)
  • .github/workflows/autofix.yml (3 hunks)
  • NOTICE (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • NOTICE
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/autofix.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Build (macos)
  • GitHub Check: Build (windows)
  • GitHub Check: autofix
  • GitHub Check: Analyze (go)
  • GitHub Check: Lint (golangci)
  • GitHub Check: Review Dependency Licenses
  • GitHub Check: Run pre-commit hooks
  • GitHub Check: Summary

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mergify

mergify Bot commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

Warning

This PR exceeds the recommended limit of 1,000 lines.

Large PRs are difficult to review and may be rejected due to their size.

Please verify that this PR does not address multiple issues.
Consider refactoring it into smaller, more focused PRs to facilitate a smoother review process.

@mergify

mergify Bot commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify Bot added the needs-cloudposse Needs Cloud Posse assistance label Oct 21, 2025
@codecov

codecov Bot commented Oct 21, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.45%. Comparing base (68bd160) to head (9e529e5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1690      +/-   ##
==========================================
+ Coverage   66.43%   66.45%   +0.02%     
==========================================
  Files         357      357              
  Lines       41126    41126              
==========================================
+ Hits        27322    27331       +9     
+ Misses      11768    11759       -9     
  Partials     2036     2036              
Flag Coverage Δ
unittests 66.45% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@osterman Erik Osterman (Cloud Posse) (osterman) added the no-release Do not create a new release (wait for additional code changes) label Oct 21, 2025
@mergify

mergify Bot commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

💥 This pull request now has conflicts. Could you fix it Erik Osterman (Cloud Posse) (@osterman)? 🙏

@mergify mergify Bot added the conflict This PR has conflicts label Oct 21, 2025
Resolved conflict in .github/workflows/license-check.yml by:
- Keeping our comprehensive license-check action approach
- Adding timeout-minutes: 10 from main
- Adding pull_request types filter from main
- Preserving our action-based implementation with PR commenting
@mergify mergify Bot removed the conflict This PR has conflicts label Oct 21, 2025
go-licenses v1.6.0 fails when encountering stdlib packages without module info.
This is a known issue (google/go-licenses#128) but doesn't affect our ability
to scan third-party dependencies.

Changes:
- Allow go-licenses report to fail (|| true)
- Filter out Fatal errors (^F) in addition to warnings/errors
- Validate we still got valid license data
- Exit with error only if no licenses found at all

This allows the action to continue and generate reports for third-party
dependencies while gracefully handling stdlib package errors.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/README.md (1)

49-49: Fix markdown lint issues for consistency.

Line 49 is missing a language specifier for the fenced code block. Lines 96, 99, and 104 use emphasis (**"..."**) where proper headings (###) would be more appropriate and consistent with markdown conventions.

-\`\`\`
+\`\`\`text
 Generating NOTICE file for Atmos...

And for the troubleshooting section:

-### Troubleshooting
-
-**"go-licenses: command not found"**
-- The script will auto-install it via `go install`
-
-**"Failed to find license for X"**
-- Some packages have non-standard license file names
-- Check the package manually and add to ignore list if needed
-- See `go-licenses` documentation for `--ignore` flag
-
-**"One or more libraries have incompatible/unknown license"**
-- This warning can be ignored for known cases (xi2/xz is public domain)
-- Review unknown licenses manually before proceeding
+### Troubleshooting
+
+#### go-licenses: command not found
+The script will auto-install it via `go install`
+
+#### Failed to find license for X
+Some packages have non-standard license file names. Check the package manually and add to ignore list if needed. See `go-licenses` documentation for `--ignore` flag.
+
+#### One or more libraries have incompatible/unknown license
+This warning can be ignored for known cases (xi2/xz is public domain). Review unknown licenses manually before proceeding.

Also applies to: 96-96, 99-99, 104-104

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d80090d and 28d068e.

📒 Files selected for processing (6)
  • .github/actions/license-check/README.md (1 hunks)
  • .github/actions/license-check/action.yml (1 hunks)
  • .github/workflows/license-check.yml (1 hunks)
  • NOTICE (1 hunks)
  • scripts/README.md (1 hunks)
  • scripts/generate-notice.sh (1 hunks)
🧰 Additional context used
🪛 LanguageTool
.github/actions/license-check/README.md

[uncategorized] ~114-~114: The official name of this software platform is spelled with a capital “H”.
Context: ... NOTICE file. ## Example Workflow See [.github/workflows/license-check.yml](../../wor...

(GITHUB)


[typographical] ~123-~123: Consider using a typographic opening quote here.
Context: ...s as artifacts ## Troubleshooting ### "Unknown licenses detected" Some depende...

(EN_QUOTES)


[typographical] ~123-~123: Consider using a typographic close quote here.
Context: ...shooting ### "Unknown licenses detected" Some dependencies may have non-standar...

(EN_QUOTES)


[typographical] ~131-~131: Consider using a typographic opening quote here.
Context: ...3-Clause (network lookup may fail) ### "NOTICE file is missing" Create a `NOTIC...

(EN_QUOTES)


[typographical] ~131-~131: Consider using a typographic close quote here.
Context: ...p may fail) ### "NOTICE file is missing" Create a NOTICE file in the reposito...

(EN_QUOTES)

scripts/README.md

[uncategorized] ~70-~70: The official name of this software platform is spelled with a capital “H”.
Context: ...with CI/CD The license check workflow (.github/workflows/license-check.yml) verifies ...

(GITHUB)


[typographical] ~96-~96: Consider using a typographic opening quote here.
Context: ... footer message ### Troubleshooting "go-licenses: command not found" - The ...

(EN_QUOTES)


[typographical] ~96-~96: Consider using a typographic close quote here.
Context: ...oting "go-licenses: command not found" - The script will auto-install it via...

(EN_QUOTES)


[typographical] ~99-~99: Consider using a typographic opening quote here.
Context: ...ill auto-install it via go install "Failed to find license for X" - Some p...

(EN_QUOTES)


[typographical] ~99-~99: Consider using a typographic close quote here.
Context: ...nstall` "Failed to find license for X" - Some packages have non-standard lic...

(EN_QUOTES)


[typographical] ~104-~104: Consider using a typographic opening quote here.
Context: ...sdocumentation for--ignore` flag **"One or more libraries have incompatible/...

(EN_QUOTES)

🪛 markdownlint-cli2 (0.18.1)
scripts/README.md

49-49: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


96-96: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


99-99: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


104-104: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Build (windows)
  • GitHub Check: Run pre-commit hooks
  • GitHub Check: Lint (golangci)
  • GitHub Check: Analyze (go)
  • GitHub Check: Check for changelog entry
  • GitHub Check: Check License Attributions
  • GitHub Check: autofix
  • GitHub Check: Summary
🔇 Additional comments (7)
.github/actions/license-check/README.md (1)

1-143: Documentation is clear and comprehensive. The README effectively explains the action's purpose, features, usage patterns, inputs/outputs, and troubleshooting guidance. Good job breaking down license types and providing actionable error messages.

Consider addressing the LanguageTool hints for typographic quotes if your project follows formal documentation standards, though the current quotes are functional.

NOTICE (1)

765-768: Investigate missing license URL for inet.af/netaddr.

Line 767 shows URL: Unknown for this dependency. While the action won't fail on this, consider manually verifying the license information and updating the URL or running generate-notice.sh to see if the tool can find it.

.github/workflows/license-check.yml (1)

1-43: Workflow consolidation looks solid. Good choices on triggering (PR changes, push to main, weekly schedule, manual dispatch) and path filters. The permissions are appropriately scoped to read contents and write PR comments. Weekly schedule is helpful for catching transitive dependency license changes.

scripts/generate-notice.sh (1)

1-148: Script is well-structured with solid error handling. Good use of set -euo pipefail, proper temporary file cleanup, and auto-installation of go-licenses. The filtering of warnings/errors (lines 30-35) and optional sections for MPL-2.0 and MIT are thoughtful touches. The CSV parsing correctly adapts for Apache-2.0 (hardcoded) vs. BSD variants (extracted from column 3).

.github/actions/license-check/action.yml (3)

71-183: Overall action logic is well-structured. The flow—setup Go, check for disallowed licenses, generate reports, analyze attribution requirements, check NOTICE completeness, detect missing attributions, and generate summaries—is sound. The missing attribution detection (lines 145-154) correctly identifies gaps by comparing required dependencies against NOTICE entries and provides copy-paste-friendly text for the PR comment. Good defensive use of || true for non-fatal failures.

Once you fix the markdown pollution issue above, this action will be solid.


202-260: PR commenting logic is clean. The script correctly finds and updates existing bot comments to avoid duplicates, or creates a new comment if none exists. The summary is user-friendly and includes actionable next steps (add entries to NOTICE or run generate-notice.sh).


145-183: Missing attribution detection is thorough. The comparison logic (using comm -23 to find entries in required dependencies but not in NOTICE) is solid. Extracting package names with sed 's/^ - //' correctly parses the NOTICE format, and the output includes the formatted text ready to copy-paste into the NOTICE file.

Verify that missing-deps.txt handles edge cases (empty lines, special characters in package names) gracefully. If packages have unusual names, the sed pattern might need adjustment.

- Add grep -v "^F" to all license-report-full.log processing
- Prevents Fatal error lines from corrupting counts and GitHub Actions outputs
- Fixes "Invalid format" error in GitHub Actions output
- Ensures consistent filtering across all grep commands
- Fix heredoc in generate-notice.sh to not add blank line before EOF
- Regenerate NOTICE file with correct single trailing newline
- Fixes pre-commit hook end-of-file-fixer check
- Replace shell variable assignments with human-readable text
- Change 'attribution_count=N' to 'Attribution-required dependencies: N'
- Change 'unknown_count=N' to 'Unknown-license dependencies: N'
- Keeps GitHub Actions outputs unchanged for automation
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 21, 2025
- Replace '|| echo "0"' with '|| true' for grep -c commands
- grep -c already outputs '0' when no matches found, but returns exit code 1
- The '|| echo "0"' was appending a second '0', creating "0\n0" in variables
- This caused GitHub Actions 'Invalid format' errors in outputs
- Affects ATTRIBUTION_COUNT and UNKNOWN_COUNT variables
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 21, 2025
## What Changed

- **Removed** custom .github/actions/license-check/ action (264 lines of brittle bash)
- **Removed** custom .github/workflows/license-check.yml workflow (44 lines)
- **Added** GitHub's native dependency-review-action workflow
- **Updated** scripts/README.md to document new approach

## Why This Is Better

**Reliability:**
- No more fighting with go-licenses stdlib errors (issue #128)
- No more grep -c edge cases with duplicate zeros
- No more GitHub Actions output format errors
- GitHub's license data from ClearlyDefined (industry standard)

**Simplicity:**
- 18 lines of workflow vs 308 lines of custom code
- Zero maintenance burden - GitHub maintains the action
- Works across all ecosystems, not just Go

**Functionality:**
- Still validates licenses on every PR
- Still blocks copyleft/restrictive licenses (GPL, LGPL, AGPL)
- Still checks for security vulnerabilities
- Automatically comments on PRs with details

## NOTICE File Generation

The NOTICE file remains in the repository and is updated manually using:
```bash
./scripts/generate-notice.sh
```

This is intentional to:
- Allow human review of license changes
- Keep file stable across builds
- Separate validation (automated) from documentation (manual)

## Migration Notes

License compliance is now enforced by GitHub's native dependency graph
rather than running go-licenses in CI. This is more reliable and requires
zero custom code to maintain.
@github-actions

github-actions Bot commented Oct 21, 2025 •

Copy link
Copy Markdown

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
actions/autofix-ci/action ff86a557419858bb967097bfc916833f5647fa8c UnknownUnknown
actions/runs-on/action 2.*.* 🟢 4.3
Details
CheckScoreReason
Code-Review⚠️ 0Found 0/18 approved changesets -- score normalized to 0
Maintained🟢 56 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Binary-Artifacts🟢 7binaries present in source code
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
License🟢 10license file detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Vulnerabilities🟢 100 existing vulnerabilities detected
Branch-Protection🟢 3branch protection is not maximal on development and all release branches
Security-Policy⚠️ 0security policy file not detected
Packaging🟢 10packaging workflow detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
actions/actions/checkout 4.*.* 🟢 6.7
Details
CheckScoreReason
Maintained🟢 56 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 5
Code-Review🟢 10all changesets reviewed
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Signed-Releases⚠️ -1no releases found
Packaging⚠️ -1packaging workflow not detected
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ -1internal error: error during GetBranch(releases/v2): error during branchesHandler.query: internal error: githubv4.Query: Resource not accessible by integration
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST🟢 8SAST tool detected but not run on all commits
actions/actions/dependency-review-action 4.*.* 🟢 7.7
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Code-Review🟢 10all changesets reviewed
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Security-Policy🟢 9security policy file detected
Token-Permissions🟢 9detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Pinned-Dependencies⚠️ 2dependency not pinned by hash detected -- score normalized to 2
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection🟢 6branch protection is not maximal on development and all release branches
SAST🟢 10SAST tool is run on all commits
Vulnerabilities🟢 64 existing vulnerabilities detected
actions/actions/setup-go 5.*.* 🟢 5.9
Details
CheckScoreReason
Maintained🟢 45 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4
Code-Review🟢 10all changesets reviewed
Packaging⚠️ -1packaging workflow not detected
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Vulnerabilities🟢 100 existing vulnerabilities detected
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9

Scanned Files

  • .github/workflows/autofix.yml
  • .github/workflows/dependency-review.yml
  • .github/workflows/license-check.yml

## What Changed

Added `actions/go-dependency-submission@v2` action to submit Go dependencies
to GitHub's dependency graph before running dependency-review-action.

## Why

The dependency-review-action only detected workflow files (actions/checkout, etc)
and not the actual Go dependencies from go.mod because:

1. GitHub's dependency graph needs build-time detection for Go modules
2. The `go-dependency-submission` action resolves transitive dependencies
3. This provides accurate license detection for all 405 Go dependencies

## How It Works

1. **go-dependency-submission** job:
   - Analyzes go.mod and resolves all dependencies
   - Submits complete dependency tree to GitHub's dependency graph

2. **dependency-review** job:
   - Waits for dependency submission to complete
   - Reviews all Go dependencies for license compliance
   - Comments on PR if issues found

## References

- https://github.com/actions/go-dependency-submission
- https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api
…mission)

## What Changed

Removed the `go-dependency-submission` job that was failing and returned
to the simple dependency-review-action workflow.

## Why This Is Correct

The dependency-review-action **already works with Go modules** by:
1. Detecting go.mod changes automatically via GitHub's dependency graph
2. Reviewing dependency **changes** between base and PR branches
3. Commenting on PRs when new/changed dependencies have license issues

## Why This PR Shows No Go Dependencies

This PR only changes:
- Workflow files (.github/workflows/)
- NOTICE file (documentation)
- Scripts (scripts/)

**It doesn't modify go.mod or go.sum**, so there are no Go dependency changes
to review. The action correctly scanned the workflow dependencies (actions/checkout,
actions/dependency-review-action) and found no issues.

## Testing the Go License Checking

To test Go license detection, a PR would need to:
1. Add/update a dependency in go.mod (e.g., `go get some/package`)
2. The action will detect the new dependency
3. If it has a denied license (GPL/LGPL/AGPL), the check will fail
4. A comment will be posted with details

## Recommendation

Keep this simple workflow. It correctly handles:
- ✅ Go module license compliance (on go.mod changes)
- ✅ Workflow dependency compliance (actions)
- ✅ Security vulnerability detection
- ✅ Zero maintenance burden
@osterman Erik Osterman (Cloud Posse) (osterman) changed the title Add license attribution check action Replace custom license-check with GitHub dependency-review-action Oct 21, 2025
- dependency-review.yml: Validate NOTICE is up-to-date on PRs
- autofix.yml: Auto-generate and commit NOTICE when dependencies change

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Previously only ran when go.mod/go.sum changed, but we want it to run
on all PRs to ensure NOTICE file stays up-to-date.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Includes fixes for PR checkout issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
The autofix-ci action needs read access to upload artifacts and
interact with the GitHub API. Without this permission, artifact
uploads fail with JSON parsing errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
scripts/README.md (2)

49-49: Specify language identifier on the code block.

The example output block should declare its language to improve formatting and syntax highlighting.

-```
+```bash
 Generating NOTICE file for Atmos...

92-102: Use heading syntax instead of emphasis for subsection labels.

Lines 92, 95, and 100 use bold emphasis (**text**) for troubleshooting items; consider using proper Markdown headings (#### text) for consistency and better semantic structure.

 ### Troubleshooting
 
-**"go-licenses: command not found"**
+#### "go-licenses: command not found"
 - The script will auto-install it via `go install`
 
-**"Failed to find license for X"**
+#### "Failed to find license for X"
 - Some packages have non-standard license file names
 - Check the package manually and add to ignore list if needed
 - See `go-licenses` documentation for `--ignore` flag
 
-**"One or more libraries have incompatible/unknown license"**
+#### "One or more libraries have incompatible/unknown license"
 - This warning can be ignored for known cases (xi2/xz is public domain)
 - Review unknown licenses manually before proceeding
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4a5d01a and a2709e0.

📒 Files selected for processing (4)
  • .github/workflows/autofix.yml (3 hunks)
  • .github/workflows/dependency-review.yml (1 hunks)
  • .github/workflows/license-check.yml (0 hunks)
  • scripts/README.md (1 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/license-check.yml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: aknysh
PR: cloudposse/atmos#944
File: go.mod:206-206
Timestamp: 2025-01-17T00:18:57.769Z
Learning: For indirect dependencies with license compliance issues in the cloudposse/atmos repository, the team prefers to handle them in follow-up PRs rather than blocking the current changes, as these issues often require deeper investigation of the dependency tree.
🪛 LanguageTool
scripts/README.md

[typographical] ~92-~92: Consider using a typographic opening quote here.
Context: ... footer message ### Troubleshooting "go-licenses: command not found" - The ...

(EN_QUOTES)


[typographical] ~92-~92: Consider using a typographic close quote here.
Context: ...oting "go-licenses: command not found" - The script will auto-install it via...

(EN_QUOTES)


[typographical] ~95-~95: Consider using a typographic opening quote here.
Context: ...ill auto-install it via go install "Failed to find license for X" - Some p...

(EN_QUOTES)


[typographical] ~95-~95: Consider using a typographic close quote here.
Context: ...nstall` "Failed to find license for X" - Some packages have non-standard lic...

(EN_QUOTES)


[typographical] ~100-~100: Consider using a typographic opening quote here.
Context: ...sdocumentation for--ignore` flag **"One or more libraries have incompatible/...

(EN_QUOTES)

🪛 markdownlint-cli2 (0.18.1)
scripts/README.md

49-49: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


92-92: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


95-95: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


100-100: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Build (windows)
  • GitHub Check: Run pre-commit hooks
  • GitHub Check: Analyze (go)
  • GitHub Check: autofix
  • GitHub Check: Lint (golangci)
  • GitHub Check: Review Dependency Licenses
  • GitHub Check: Summary
🔇 Additional comments (4)
.github/workflows/dependency-review.yml (2)

25-39: License deny-list is well-structured and appropriate.

The comprehensive copyleft and restrictive license filtering aligns with industry-standard compliance practices. The fail-on-severity level and PR commenting provide clear developer feedback.


41-48: Validate NOTICE generation robustness and clarify duplication across workflows.

The script is called here and also in autofix.yml (line 65). Two considerations:

  1. Robustness: Ensure ./scripts/generate-notice.sh handles failures gracefully (e.g., if go-licenses is unavailable or network calls fail). The error message on line 47 is helpful but won't be reached if the script silently fails.

  2. Duplication: Confirm whether running generate-notice.sh in both workflows is intentional or if it should run in only one place to avoid redundant work.

.github/workflows/autofix.yml (2)

7-8: Permissions addition looks correct, but verify no unintended side effects.

Changing from unspecified (permissive) to explicit contents: read is the right move for least-privilege. However, confirm that:

  • The autofix-ci action (line 67) doesn't rely on implicit elevated permissions
  • The overall job behavior remains unchanged (especially for private runners with custom tags)

Also applies to: 17-18


63-65: NOTICE generation step placement and dependency are well-reasoned.

Running generate-notice.sh after pre-commit fixes but before autofix-ci ensures the artifact is ready. The step comment explains intent clearly. Just confirm the script exists and is executable at that path.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 21, 2025
The autofix-ci action may need actions:write permission for artifact
uploads to work properly with GitHub's API.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
RunsOn requires the runs-on/action@v2 step when using extras=s3-cache
with actions/upload-artifact. Without this action, artifact uploads fail
with JSON parsing errors because the S3 cache backend is not properly
configured.

See: https://runs-on.com/features/s3-cache-for-github-actions/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions

Copy link
Copy Markdown

These changes were released in v1.196.0-rc.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release Do not create a new release (wait for additional code changes) size/xl Extra large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants