Skip to content

Conversation

@johnvincentcorpuz
Copy link
Contributor

@johnvincentcorpuz johnvincentcorpuz commented Dec 23, 2025

Summary

Integrate PR integration enhancements from maas-build-actions #581 into the FOSSA Guard GitHub Action wrapper.

This PR completes the PR integration feature set by adding support for diff mode and license enrichment, along with comprehensive documentation updates.

The PR diff feature will only report new issues found on the PR when diffing against the default branch.
Status checks are also emitted as part of the action.
image

Changes Made

Environment Variable Mapping for Status Check and PR Commenting.

  • Mapped the 3 new inputs to environment variables for the Python script
  • Added GitHub context variables that are automatically available:
    • GITHUB_EVENT_NAME, GITHUB_REF, GITHUB_SHA, GITHUB_HEAD_REF, GITHUB_BASE_REF

Comprehensive Documentation Updates

New Sections in README

  • Mode Behavior Clarification - BLOCK vs REPORT modes explained
  • Diff Mode - How it works, requirements, and usage
  • PR Comment Features - Complete list of PR comment capabilities
  • Status Check Behavior - How status checks work in different modes
  • Migration Path - Step-by-step gradual adoption guide
  • Reference Links - Links to source PR and live examples

Enhanced Workflow Examples

  • Basic PR Integration
  • With Diff Mode (Recommended for PRs) - Shows both licensing and vulnerability checks
  • REPORT Mode Example (Non-blocking) - For gradual rollout

Improved Troubleshooting

  • Added "Diff Mode Not Working" troubleshooting section
  • Enhanced existing sections with additional checks

Key Features

Diff Mode - Compares PR branch against base, shows only newly introduced issues, auto-detects default branch
License Enrichment - Shows declared vs discovered license indicators
Complete PR Integration - Comments, status checks, and diff mode work together seamlessly

Backwards Compatibility

Fully backwards compatible - All new features are opt-in with sensible defaults:

  • enable_diff_mode: false (disabled by default)
  • enable_license_enrichment: true (enabled by default)

Existing workflows continue to work without any changes.

Files Changed

.github/actions/fossa-guard/README.md   | +192 -3
.github/actions/fossa-guard/action.yaml | +22

Related

Next Steps

  1. Review and approve this PR
  2. Merge to enable the new features
  3. Update consuming repositories to use diff mode
  4. Docker image uses :latest tag which will pull the final merged version from maas-build-actions

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

johnvincentcorpuz and others added 5 commits December 23, 2025 13:41
Integrate PR integration enhancements from maas-build-actions #581:
- Add enable_diff_mode input to show only newly introduced issues
- Add diff_base_revision_sha input for base branch comparison
- Add enable_license_enrichment input for license indicators
- Pass GitHub context variables (EVENT_NAME, REF, SHA, HEAD_REF, BASE_REF)
- Update README with comprehensive examples and documentation

New Features:
- Diff mode compares PR against base branch (auto-detects default branch)
- License enrichment shows declared/discovered indicators
- Enhanced PR workflow examples (basic, diff mode, REPORT mode)
- Mode behavior clarification (BLOCK vs REPORT)
- Migration path for gradual adoption

All features are opt-in and backwards compatible.

Related: SolaceDev/maas-build-actions#581

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

Co-Authored-By: Claude <[email protected]>
@johnvincentcorpuz johnvincentcorpuz changed the title wip feat(DATAGO-121121): Add PR diff feature and PR comment and status check with fossa-guard. Jan 13, 2026
@johnvincentcorpuz johnvincentcorpuz marked this pull request as ready for review January 13, 2026 21:26
Make PR integration opt-in by setting defaults to false:
- enable_pr_comment: false (was true)
- enable_status_check: false (was true)

This ensures backwards compatibility and requires users to
explicitly enable PR integration features.

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

Co-Authored-By: Claude <[email protected]>
description: "GitHub token for PR comments and status checks"
required: false
default: ${{ github.token }}
enable_pr_comment:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is off by default.

Copy link
Contributor

@shooshmand-sol shooshmand-sol left a comment

Choose a reason for hiding this comment

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

👍

@johnvincentcorpuz johnvincentcorpuz merged commit 1f08173 into main Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants