@@ -314,6 +314,7 @@ PyLynk automatically detects and captures CI/CD environment information when run
314
314
# ## Automatic PR and Build Information Extraction
315
315
316
316
When running in a CI environment during SBOM uploads, PyLynk automatically extracts:
317
+ - ** Event Information** : Event type (pull_request, push, release), release tag (when applicable)
317
318
- ** Pull Request Information** : PR number, URL, source/target branches, ** author** (when in PR context)
318
319
- ** Build Information** : Build ID, number, URL, commit SHA
319
320
- ** Repository Information** : Repository name, owner, URL
333
334
branches: [ main ]
334
335
push:
335
336
branches: [ main ]
337
+ release:
338
+ types: [ published ]
336
339
337
340
jobs:
338
341
upload-sbom:
@@ -350,6 +353,8 @@ jobs:
350
353
run: |
351
354
python3 pylynk.py upload --prod ' my-product' --sbom sbom.json
352
355
# PyLynk automatically captures:
356
+ # - Event type (pull_request, push, or release)
357
+ # - Release tag (for release events)
353
358
# - PR number and branches (for pull_request events)
354
359
# - PR author (GITHUB_ACTOR)
355
360
# - Commit SHA and build URL
@@ -369,8 +374,17 @@ pipelines:
369
374
script:
370
375
- pip install -r requirements.txt
371
376
- 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
372
384
# 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)
374
388
# - PR author (BITBUCKET_STEP_TRIGGERER_UUID)
375
389
# - Build number and URL
376
390
# - Repository information
@@ -385,6 +399,10 @@ PyLynk also supports generic CI environments by checking common environment vari
385
399
| Variable | Description | Maps to Header |
386
400
| ----------| -------------| ----------------|
387
401
| ` 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` |
388
406
| ** Pull Request Variables** | | |
389
407
| ` PULL_REQUEST_NUMBER` | PR number | ` X-PR-Number` |
390
408
| ` 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:
488
506
| Header | Description | Example |
489
507
|--------|-------------|---------|
490
508
| `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` |
491
511
| `X-PR-Number` | Pull request number | `123` |
492
512
| `X-PR-URL` | Pull request URL | `https://github.com/org/repo/pull/123` |
493
513
| `X-PR-Source-Branch` | PR source branch | `feature/new-feature` |
0 commit comments