Git Product home page Git Product logo

gh-python-generate-sbom's Introduction

Website Slack Invite Group Discussion Twitter

GitHub action to generate a CycloneDX SBOM for Python

Inputs

input

The path to a pip requirements file, default is "./requirements.txt"

Be sure to quote paths with spaces.

output

Output filename, default is "./bom.xml"

Be sure to quote paths with spaces.

format

Output format, one of "json"/"xml", default is "xml"

Example usage

- name: Generate Python SBOM
  uses: CycloneDX/gh-python-generate-sbom@v2
  with:
    input: ./requirements.txt
    output: ./bom.json
    format: json

Internals

This GitHub ation depends on cyclonedx-bom>=1.4.0,<4. See cyclonedx-bom on PyPI.

gh-python-generate-sbom's People

Contributors

coderpatros avatar danielcuthbert avatar jkowalleck avatar juliojimenez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gh-python-generate-sbom's Issues

pyproject.toml does not appear to be supported

The generator mentions using requirements.txt. However, the Python community is moving away from using requirements.txt to integrating the build system and all requirements into a pyproject.toml file. Any chance this will be added to gh-python-generate-sbom?

Using a non-default input path causes the action to fail

When using either v1.0.0 or v1.0.1 of the action it fails when attempting to run the command to actually generate the bom. When running the 1.0.0 version of the action I get the log output:

Options:
  i: ./xxxxx/requirements.txt
  o: ./bom.xml
Running: cyclonedx-py -i ./xxxxx/requirements.txt -o ./pythonsbom.xml
usage: cyclonedx-py [-h] (-c | -cj | -e | -p | -pip | -r) [-i FILE_PATH]
                    [--format {xml,json}]
                    [--schema-version {1.4,1.3,1.2,1.1,1.0}] [-o FILE_PATH]
                    [-F] [-pb] [-X]
cyclonedx-py: error: one of the arguments -c/--conda -cj/--conda-json -e/--e/--environment -p/--p/--poetry -pip/--pip -r/--r/--requirements is required
Error: Command failed: cyclonedx-py -i ./xxxxx/requirements.txt -o ./bom.xml
usage: cyclonedx-py [-h] (-c | -cj | -e | -p | -pip | -r) [-i FILE_PATH]
                    [--format {xml,json}]
                    [--schema-version {1.4,1.3,1.2,1.1,1.0}] [-o FILE_PATH]
                    [-F] [-pb] [-X]
cyclonedx-py: error: one of the arguments -c/--conda -cj/--conda-json -e/--e/--environment -p/--p/--poetry -pip/--pip -r/--r/--requirements is required

That lead me to believe that since the -r flag wasn't set it was causing the command to fail. The 1.0.1 version doesn't actually give any output when it fails.

I was able to successfully generate a bom when I instead just ran the command to generate the bom in the workflow and provided it the -r flag.

If there's anything else that I can provide that would help just let me know.

fix version constraint.

this GH action is compatible with current cyclonedx-py.
it is incompatible to theupcoming changes in version cyclonedx-py@4.

therefore, the version constaint needs to be done in pip install and current detection.

Fails on Ubuntu Runners

Hey @coderpatros,

first of all, thanks for providing this action!

I came across the problem that this action fails on ubuntu.
This repository executes the action for all available runners. As you can see it works on the other OS' perfectly.
Also when installing/running cyclonedx-bom on a local ubuntu it works fine for 18.04 and 20.04 (haven't tried 16.04).

I would be awesome if you could have a look at it :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.