Retrieve all requested SBOMs from the GitHub repositories.

Overview

GitHub SBOM(s) Generator Action

License

This GitHub Action and/or standalone CLI application generates a Software Bill of Materials (SBOM) for a given GitHub repository or a list of repositories, using the GitHub Dependency Graph API. The Software Bill of Materials that is generated based on the SPDX specification and is saved in JSON format. The GitHub Action is a composite action that you can easily integrate in your existing workflows.

Usage

There are two ways to use this repository. One way is to use it as a composite GitHub action, the other is to use it as a standalone commandline application. Both ways are explained below.

Usage GitHub Action

To use this composite action in your workflow, you can include the following step in your workflow YAML file:

- name: Generate GitHub SBOMs
  uses: brend-smits/github-sbom-generator-action@<tag-or-branch>
  with:
    repo_list_path: <path-to-repo-list-file>
    save_directory_path: <path-to-save-directory>
    github_token: ${{ secrets.GITHUB_TOKEN }}

Replace <tag-or-branch> with the specific tag or branch of the composite action that you want to use, <path-to-repo-list-file> with the path to a file containing a list of repository names, and <path-to-save-directory> with the path to the directory where you want to save the retrieved SBOMs. Also, make sure to provide the GITHUB_TOKEN secret in your workflow to authenticate with the GitHub API.

The composite action requires the following input:

  • repoListPath: The path to a file containing a list of repository names to retrieve SBOMs for.
  • saveDirectoryPath: The path to the directory where the retrieved SBOMs will be saved.
  • token: The GitHub API token for authentication.

The composite action produces no outputs.

Example

Here's an example of how you can use the composite action in your workflow:

name: Retrieve SBOMs

on:
  push:
    branches:
      - main

jobs:
  retrieve-sboms:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v3

    - name: Retrieve GitHub SBOMs
      uses: brend-smits/[email protected] # x-release-please-version
      with:
        repo_list_path: gh-repos.txt
        save_directory_path: sboms
        github_token: ${{ secrets.GITHUB_TOKEN }}

      - name: Upload all sboms
        uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
        with:
          name: all-repos-sboms
          path: sboms

This workflow retrieves SBOMs for repositories listed in the gh-repos.txt file and saves them to a sboms directory.

Usage CLI Application

Please refer to CONTRIBUTING.md on how to build and run the application locally. There is currently no binary that is distributed yet.

Usecases

Having the ability to retrieve (all) SBOM(s) from an organization in e.g. a central repository allows you to do all sorts of fun things like:

State

⚠️ Experimental!

This application/action is new and still undergoing testing. Feel free to give it a try and give suggestions or feedback by creating a new GitHub Issue.

Comments
  • chore(main): release 1.0.3

    chore(main): release 1.0.3

    :robot: I have created a release beep boop

    1.0.3 (2023-04-21)

    Bug Fixes

    • create directory if it does not exist yet (48485fc)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by Brend-Smits 1
  • chore(main): release 1.0.2

    chore(main): release 1.0.2

    :robot: I have created a release beep boop

    1.0.2 (2023-04-21)

    Bug Fixes

    • change curl output to include action_path (1618108)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by Brend-Smits 1
  • chore(main): release 1.0.1

    chore(main): release 1.0.1

    :robot: I have created a release beep boop

    1.0.1 (2023-04-21)

    Bug Fixes

    • give actions the proper credentials to upload binaries (a361b57)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by Brend-Smits 1
  • chore(main): release 1.0.0

    chore(main): release 1.0.0

    :robot: I have created a release beep boop

    1.0.0 (2023-04-21)

    Features

    • add ci and release workflow (911aa36)
    • move away from bash and use rust cli in action (bfd4af8)
    • open repo list path and loop through each line (d77e549)
    • save spdx files to configured directory (1ca1b4b)

    Bug Fixes

    • ci: annotate files for release-please (30ecdcc)
    • ci: only run test workflow on non release prs (b3e67ca)
    • ci: skip test workflow when ref_name contains release-please (9bf27b9)
    • directories were not being created if they did not exist (ffdf7ba)

    Miscellaneous Chores


    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by Brend-Smits 1
  • feature/use rust

    feature/use rust

    This PR adds a Rust CLI application that makes it possible to fetch SBOMs from GitHub Dependency Graph API based on a repository list file. I have not yet added a CI/CD pipeline, this will be part of a future PR. I have also not migrated the action.yaml composite action steps to make use of this new CLI application. This will also be done in a different PR.

    Commits:

    • cargo initialize
    • add cli arguments with parser
    • query gh api using reqwester crate
    • refactor: move into seperate function
    • feat: open repo list path and loop through each line
    • move read file logic to different function
    • tests: add integration tests
    • token is now optional and add various error handling
    • feat: save spdx files to configured directory
    • fix broken tests
    • minor refactor
    • docs: update documentation and rename project
    • change action name
    enhancement 
    opened by Brend-Smits 0
  • chore(main): release 1.0.4

    chore(main): release 1.0.4

    :robot: I have created a release beep boop

    1.0.4 (2023-04-21)

    Bug Fixes

    • failing tests due to repo name change (8535cf1)

    This PR was generated with Release Please. See documentation.

    autorelease: pending 
    opened by Brend-Smits 0
  • Debug mode seems to always get enabled when -d is specified

    Debug mode seems to always get enabled when -d is specified

    Missing logic to check when the option is entered, if the value is actually set to -d true. We currently assume it's always true if someone adds the -d option. Which makes it incompatible with current composite action.

    opened by Brend-Smits 0
Releases(v1.0.3)
Owner
Brend Smits
Software Engineer at @philips-software focussing on Open/Inner Source tooling and Software Bill of Materials. 📚 Busy setting up the OSPO of Philips.
Brend Smits
Delete useless GitHub repositories easily.

delete-unused-repo Delete useless GitHub repositories easily. Demo del-unused-repo.mp4 Usage Warning You are responsible for your own actions, this is

null 2 Aug 9, 2022
Quickly save and retrieve values for shell scripts.

Quickly save and retrieve values for shell scripts.

Alex Andrade 2 Dec 15, 2022
This tool will profile official instances of OpenSUSE mirrorcache to determine the fastest repositories for your system

Mirror Magic tool to Magically make OpenSUSE Mirrors Magic-er This tool will profile official instances of OpenSUSE mirrorcache to determine the faste

Firstyear 30 Dec 22, 2022
Gix is a command-line interface (CLI) to access git repositories

gix is a command-line interface (CLI) to access git repositories. It's written to optimize the user-experience, and perform as good or better than the

Sebastian Thiel 5.2k Jan 5, 2023
gfold is a CLI-driven application that helps you keep track of multiple Git repositories.

gfold is a CLI-driven application that helps you keep track of multiple Git repositories.

Nick Gerace 215 Jan 4, 2023
A tool to dump exposed .git repositories

git-dumper This repository houses a tool to dump exposed .git repositories. This is a rewrite from the original GitTools's Dumper project, but in a re

HoLLy 10 Dec 13, 2022
A tool to dump exposed .git repositories

git-dumper This repository houses a tool to dump exposed .git repositories. This is a rewrite from the original GitTools's Dumper project, but in a re

HoLLy 8 Nov 1, 2022
Mirroring remote repositories to s3 storage, with atomic updates and periodic garbage collection.

rsync-sjtug WIP: This project is still under development, and is not ready for production use. rsync-sjtug is an open-source project designed to provi

SJTUG 57 Feb 22, 2023
Check a folder for dirty git repositories, forgotten branches and commits

dg - find dirty git repos Ever forgot to push a commit or lost your work because you assumed it was pushed to Github but it wasn't? dg finds local git

Dotan J. Nahum 11 Mar 19, 2023
A simple cli to clone projects and fetch all projects in a GitHub org..

stupid-git A simple cli to clone projects and update all projects. get all repository from GitHub clone all pull all with git stash Usage create sgit.

Fengda Huang 5 Sep 15, 2022
ddi is a wrapper for dd. It takes all the same arguments, and all it really does is call dd in the background

ddi A safer dd Introduction If you ever used dd, the GNU coreutil that lets you copy data from one file to another, then you may have encountered a ty

Tomás Ralph 80 Sep 8, 2022
Scan the symbols of all ELF binaries in all Arch Linux packages for usage of malloc_usable_size

Scan the symbols of all ELF binaries in all Arch Linux packages for usage of malloc_usable_size (-D_FORTIFY_SOURCE=3 compatibility)

null 3 Sep 9, 2023
Download binary for your OS from Github

github-bin-downloader Download binary for your OS from Github. Installation Install github-bin-downloader using cargo cargo install github-bin-downloa

353fc443 10 Dec 11, 2022
A cli tool to download specific GitHub directories or files

cloneit A cli tool to download specific GitHub directories or files. Installation From git git clone https://github.com/alok8bb/cloneit cd cloneit car

Alok 54 Dec 20, 2022
Github user information on terminal :D

octofetch Use this if youre too lazy to open github lol Installation Local install with cargo Run cargo install --git https://github.com/azur1s/octofe

Natapat Samutpong 65 Nov 2, 2022
❗️ Small script to view GitHub notifications in the terminal

github-notifications Small script to view GitHub notifications in the terminal Shows and color-codes the notification source, eg if you're the owner o

Brian Shaginaw 1 Jan 10, 2022
CLI tool for generating a summary of recent github activity for people who are incredibly forgetful

CLI tool for generating a summary of recent github activity for people who are incredibly forgetful but still need to give weekly status updates to their boss without getting depressed and convincing themselves they did nothing because they can't remember what they did!

Jane Lusby 50 Dec 23, 2022
A command-line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.

Pup A command line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the return

SteveLau 11 Aug 17, 2022
View your github contribution calander in unicode.

View your github contribution calander in the terminal Now in rust! gh-cal 0.1.0 marshmallow View your github contribution calander in unicode USAGE:

marshmallow 54 Sep 12, 2022