Skip to content

Conversation

@javirln
Copy link
Member

@javirln javirln commented Jan 7, 2026

Add support for automatic pull request and merge request metadata collection when Chainloop runs via Dagger inside Github Actions or Gitlab CI pipelines.

Changes

Dagger Module (extras/dagger/)

  • Extended Init() function with optional parameters to accept parent CI context (Github and Gitlab environment variables)
  • Added internal ParentCIContext struct to organize parent CI environment data
  • Updated cliContainer() to inject parent CI environment variables and mount Github event file into the container

PR Detection (pkg/attestation/crafter/prmetadata.go)

  • Added support for DAGGER_PIPELINE runner type in DetectPRContext()
  • Detection logic checks for Github context first, then Gitlab context when running in Dagger

Documentation (extras/dagger/README.md)

  • Added "PR/MR Auto-Detection in Parent CI" section with examples for both Dagger SDK (Go) and Dagger CLI usage
  • Documented all required environment variables for Github Actions and Gitlab CI

All parameters are optional and backward compatible. PR detection fails gracefully if environment variables are missing or invalid.

@javirln javirln marked this pull request as ready for review January 7, 2026 13:56
@javirln javirln self-assigned this Jan 7, 2026
Copy link
Member

@jiparis jiparis left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Signed-off-by: Javier Rodriguez <[email protected]>
Signed-off-by: Javier Rodriguez <[email protected]>
@javirln javirln merged commit 1f3f776 into chainloop-dev:main Jan 8, 2026
13 checks passed
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.

3 participants