@@ -314,6 +314,7 @@ PyLynk automatically detects and captures CI/CD environment information when run
314314# ## Automatic PR and Build Information Extraction
315315
316316When running in a CI environment during SBOM uploads, PyLynk automatically extracts:
317+ - ** Event Information** : Event type (pull_request, push, release), release tag (when applicable)
317318- ** Pull Request Information** : PR number, URL, source/target branches, ** author** (when in PR context)
318319- ** Build Information** : Build ID, number, URL, commit SHA
319320- ** Repository Information** : Repository name, owner, URL
333334 branches: [ main ]
334335 push:
335336 branches: [ main ]
337+ release:
338+ types: [ published ]
336339
337340jobs:
338341 upload-sbom:
@@ -350,6 +353,8 @@ jobs:
350353 run: |
351354 python3 pylynk.py upload --prod ' my-product' --sbom sbom.json
352355 # PyLynk automatically captures:
356+ # - Event type (pull_request, push, or release)
357+ # - Release tag (for release events)
353358 # - PR number and branches (for pull_request events)
354359 # - PR author (GITHUB_ACTOR)
355360 # - Commit SHA and build URL
@@ -369,8 +374,17 @@ pipelines:
369374 script:
370375 - pip install -r requirements.txt
371376 - python3 pylynk.py upload --prod ' my-product' --sbom sbom.json
377+ tags:
378+ ' v*' :
379+ - step:
380+ name: Upload SBOM for Release
381+ script:
382+ - pip install -r requirements.txt
383+ - python3 pylynk.py upload --prod ' my-product' --sbom sbom.json
372384 # PyLynk automatically captures:
373- # - PR ID and branches
385+ # - Event type (pull_request, push, or release)
386+ # - Release tag (for tag-triggered builds)
387+ # - PR ID and branches (for PR events)
374388 # - PR author (BITBUCKET_STEP_TRIGGERER_UUID)
375389 # - Build number and URL
376390 # - Repository information
@@ -385,6 +399,10 @@ PyLynk also supports generic CI environments by checking common environment vari
385399| Variable | Description | Maps to Header |
386400| ----------| -------------| ----------------|
387401| ` CI` | Set to ` true` to indicate CI environment | Enables CI detection |
402+ | ** Release Variables** | | |
403+ | ` GIT_TAG` | Git tag for release builds | ` X-Release-Tag` |
404+ | ` CI_COMMIT_TAG` | GitLab CI tag variable | ` X-Release-Tag` |
405+ | ` TAG_NAME` | Alternative tag name variable | ` X-Release-Tag` |
388406| ** Pull Request Variables** | | |
389407| ` PULL_REQUEST_NUMBER` | PR number | ` X-PR-Number` |
390408| ` PR_NUMBER` | Alternative PR number variable | ` X-PR-Number` |
@@ -488,6 +506,8 @@ The extracted CI information is sent as HTTP headers with upload API requests:
488506| Header | Description | Example |
489507|--------|-------------|---------|
490508| `X-CI-Provider` | CI platform name | `github_actions`, `bitbucket_pipelines`, `generic_ci` |
509+ | `X-Event-Type` | CI event type | `pull_request`, `push`, `release` |
510+ | `X-Release-Tag` | Release tag name (when event is release) | `v1.2.3` |
491511| `X-PR-Number` | Pull request number | `123` |
492512| `X-PR-URL` | Pull request URL | `https://github.com/org/repo/pull/123` |
493513| `X-PR-Source-Branch` | PR source branch | `feature/new-feature` |
0 commit comments