A GitHub Action and CLI tool for uploading Software Bill of Materials (SBOM) files to Dependency Track.
- π GitHub Action Integration - Seamless CI/CD pipeline integration
- π Multiple Upload Methods - Single SBOMs, batch uploads, or custom hierarchies
- ποΈ Hierarchical Projects - Create parent/child project relationships
- π¨ Auto Hierarchy Generation - Generate 3-level hierarchies from nested SBOM structures
- π Version Management - Semantic version comparison and latest detection
- π§ͺ Local Testing - CLI for development and debugging
- π― Auto-Detection - Extract project info from SBOM metadata
- π Secure - API key authentication with proper error handling
- π Unique Naming - UUID suffixes prevent project name conflicts
name: Upload SBOM
on: [push]
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: scality/sbom-upload@v1
with:
url: 'https://dependency-track.example.com'
api-key: ${{ secrets.DEPENDENCY_TRACK_API_KEY }}
project-sbom: 'sbom.json'# Set environment variables
export INPUT_URL="https://dependency-track.example.com"
export INPUT_API_KEY="your-api-key"
# Test connection
PYTHONPATH=src python src/main.py test-connection
# Upload single SBOM file
export INPUT_PROJECT_SBOM="sbom.json"
PYTHONPATH=src python src/main.py upload
# Upload SBOM with custom project details (via environment)
export INPUT_PROJECT_SBOM="sbom.json"
export INPUT_PROJECT_NAME="my-app"
export INPUT_PROJECT_VERSION="1.0.0"
PYTHONPATH=src python src/main.py upload- Quick Start Guide - Get started in minutes
- Usage Examples - Comprehensive examples for GitHub Actions and CLI
- Hierarchy Configuration - Advanced project structures
- CLI Reference - Complete command-line interface documentation
No installation required - just reference the action in your workflow.
git clone https://github.com/scality/sbom-upload.git
cd sbom-upload
pip install -r requirements.txt- CI/CD Integration - Automatically upload SBOMs on builds/releases
- Multi-Service Applications - Manage complex project hierarchies
- Security Compliance - Track dependencies across your organization
- Version Management - Maintain accurate version histories
- Development Workflows - Test uploads locally before deployment
| Scenario | GitHub Action | CLI | Documentation |
|---|---|---|---|
| Single SBOM Upload | β | β | Examples |
| Multiple SBOMs | β | β | Examples |
| Nested Projects | β | β | Examples |
| Auto Hierarchy Generation | β | β | Usage Examples |
| Custom Hierarchies | β | β | Hierarchy Config |
| Version Detection | β | β | Usage Examples |
| Dry Run Testing | β | β | CLI Reference |
| Input | Required | Description | Example |
|---|---|---|---|
url |
β | Dependency Track server URL | https://dt.example.com |
api-key |
β | API key for authentication | ${{ secrets.DT_API_KEY }} |
project-sbom |
β * | Path to single SBOM file | dist/sbom.json |
project-sbom-list |
β * | Path to file with SBOM list | sbom-files.txt |
project-sbom-dir |
β * | Directory containing SBOMs | dist/sboms/ |
project-name |
β | Override project name | my-application |
project-version |
β | Override project version | 1.2.3 |
parent-project-name |
β | Parent project name | main-app |
parent-project-version |
β | Parent project version | 2.0.0 |
project-classifier |
β | Project type classifier | APPLICATION |
parent-project-classifier |
β | Parent project classifier | APPLICATION |
project-collection-logic |
β | Collection logic for children | AGGREGATE_DIRECT_CHILDREN |
parent-project-collection-logic |
β | Parent collection logic | AGGREGATE_DIRECT_CHILDREN |
is-latest |
β | Mark as latest version | true |
auto-detect-latest |
β | Auto-detect latest flag | true |
api-timeout |
β | API timeout (seconds) | 300 |
dry-run |
β | Validate without uploading | true |
project-prefix |
β | Prefix for project names | ci- |
project-suffix |
β | Suffix for project names | -prod |
project-tags |
β | Comma-separated tags | production,ci-cd |
delete-on-version-suffix-match |
β | Delete existing leaf project when version matches suffix pattern (default false) |
true |
delete-version-suffix-pattern |
β | Case-insensitive regex evaluated against project version when delete is enabled (default dev) |
dev$ |
*One of project-sbom, project-sbom-list, or project-sbom-dir is required.
# Start local Dependency Track instance
cd tests
docker-compose up -d
# Test connection
PYTHONPATH=src python src/main.py test-connection
# Upload test SBOM
export INPUT_PROJECT_SBOM="tests/single_sbom/nginx_12.9.1.json"
export INPUT_DRY_RUN="true"
PYTHONPATH=src python src/main.py upload- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Dependency Track - Software composition analysis platform
- CycloneDX - SBOM standard specification
- SPDX - Software package data exchange format
- π Documentation
- π Issues
- π¬ Discussions