Code Monkey home page Code Monkey logo

drivers-github-tools's Introduction

drivers-github-tools

Important

This Repository is NOT a supported MongoDB product

This repository contains GitHub Actions that are common to drivers.

Setup

There is a common setup action that is meant to be run before all other actions. It handles fetching secrets from AWS Secrets Manager, signing into Artifactory, setting up Garasign credentials, and setting up environment variables used in other actions. The action requires id-token: write permissions.

- name: setup
  uses: mongodb/drivers-github-tools/setup@v2
  with:
    aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
    aws_region_name: ${{ vars.AWS_REGION_NAME }}
    aws_secret_id: ${{ secrets.AWS_SECRET_ID }}

Note

You must use the actions/checkout action prior to calling the setup action, Since the setup action sets up git config that would be overridden by the actions/checkout action

Signing tools

The actions in the garasign folder are used to sign artifacts using the team's GPG key.

git-sign

Use this action to create signed git artifacts:

- name: Setup
  uses: mongodb/drivers-github-tools/setup@v2
  with:
    ...

- name: Create signed commit
  uses: mongodb/drivers-github-tools/git-sign@v2
  with:
    command: "git commit -m 'Commit' -s --gpg-sign=${{ vars.GPG_KEY_ID }}"

- name: Create signed tag
  uses: mongodb/drivers-github-tools/git-sign@v2
  with:
    command: "git tag -m 'Tag' -s --local-user=${{ vars.GPG_KEY_ID }} <tag>"

gpg-sign

This action is used to create detached signatures for files:

- name: Setup
  uses: mongodb/drivers-github-tools/setup@v2
  with:
    ...

- name: Create detached signature
  uses: mongodb/drivers-github-tools/gpg-sign@v2
  with:
    filenames: somefile.ext

The action will create a signature file somefile.ext.sig in the working directory.

You can also supply a glob pattern to sign a group of files:

- name: Setup
  uses: mongodb/drivers-github-tools/setup@v2
  with:
    ...

- name: Create detached signature
  uses: mongodb/drivers-github-tools/garasign/gpg-sign@v1
  with:
    filenames: dist/*

Reporting tools

The following tools are meant to aid in generating Software Security Development Lifecycle reports associated with a product release.

Authorized Publication

This action will create a record of authorized publication on distribution channels. It will create the file $S3_ASSETS/authorized_publication.txt

- name: Setup
  uses: mongodb/drivers-github-tools/setup@v2
  with:
    ...

- name: Create Authorized Publication Report
  uses: mongodb/drivers-github-tools/authorized-pub@v2
  with:
    product_name: Mongo Python Driver
    release_version: ${{ github.ref_name }}
    filenames: dist/*
    token: ${{ github.token }}

Python Helper Scripts

These scripts are opinionated helper scripts for Python releases.

Bump and Tag

Bump the version and create a new tag. Verify the tag. Push the commit and tag to the source branch unless dry_run is set.

- name: Setup
  uses: mongodb/drivers-github-tools/setup@v2
  with:
    ...

- uses: mongodb/drivers-github-tools/python/bump-and-tag@v2
  with:
    version: ${{ inputs.version }}
    version_bump_script: ./.github/scripts/bump-version.sh
    dry_run: ${{ inputs.dry_run }}

Publish

Handles tasks related to publishing Python packages, including signing dist file and publishing the dist files to PyPI. It will also push the following (dev) version to the source branch. It will create a draft GitHub release and attach the signature files. Finally, it will publish a report to the appropriate S3 bucket. If dry_run is set, nothing will be published or pushed.

- name: Setup
  uses: mongodb/drivers-github-tools/setup@v2
  with:
    ...

- uses: mongodb-labs/drivers-github-tools/python/publish@v2
  with:
    version: ${{ inputs.version }}
    following_version: ${{ inputs.following_version }}
    version_bump_script: ./.github/scripts/bump-version.sh
    product_name: winkerberos
    token: ${{ github.token }}
    dry_run: ${{ inputs.dry_run }}

drivers-github-tools's People

Contributors

blink1073 avatar alcaeus avatar

Watchers

James Kovacs avatar Alex Bevilacqua avatar Robert Stam avatar Maurizio Casimirri avatar Rachelle Palmer avatar Massimiliano Marcon avatar Anna Henningsen avatar Jeff S avatar Basit avatar Muthukrishnan K avatar Jib avatar Satya Sinha avatar Paula Stachova avatar Emanuel Lupi avatar  avatar Matthew Chiaravalloti avatar Himanshu Singh avatar Neal Beeken avatar Avinash Prasad avatar Kyle Kloberdanz avatar Alena Khineika avatar Viacheslav Babanin avatar Ben Leembruggen avatar Nabi Rezvani avatar Andrew Walker avatar Warren James avatar Tom Selander avatar

Forkers

blink1073 alcaeus

drivers-github-tools's Issues

Add Static Scanning Action

Add an Action that handle Static Scan results. Notionally it will grab all of the dismissed and open alerts for a ref and produce a new SARIF file based on those. For the dismissed ones, Iโ€™d use the dismissed_reason in the JSON response from GitHub. We will place the file in the S3_ASSETS folder to be uploaded to the S3 bucket.

Add compliance report

Add a compliance report that links to other assets and reports created in the release. Put the report in the S3_ASSETS directory to be uploaded to the S3 bucket.

Add SBOM Handling Action

Add an action that download the full SBOM for the current project and puts it in the $RELEASE_ASSETS folder to be uploaded to the GitHub Release. We'll need credentials from the AWS vault and the name of the project as a variable.

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.