Giter Club home page Giter Club logo

snyk-badge's Introduction

snyk-badge

License: MIT Codacy Badge

Snyk badge generator for private GitHub repositories.

As of August 2019, Snyk badges currently only work for public npm packages and GitHub repositories, and will fail if pointed at a private repository. This Go app aims to solve that problem by providing badges for private repositories.

NOTE: Will only work for repositories you have integrated in Snyk.

Setup

  1. Integrate Snyk with your GitHub account
  2. Install Go
  3. Set environment variables
    SNYK_ORG_ID="Your Snyk Organisation ID"
    SNYK_API_KEY="Your Snyk API key"
    
  4. Run go build snyk.go && ./snyk
  5. Visit http://localhost:8080/badge/{username}/{repo_name}/ (Replace {username} and {repo_name} with your own GitHub username and the private repository you have access to, respectively)

Note: Trailing / is mandatory.

Note: Directory api/ is for serverless deployment on now.sh

How it works

Hits the List All Projects API and gets a list of all the projects in your organisation. Searches for the repo you mentioned in the URL and counts the number of issues in it. If the number of issues is 0, gives a green badge. If more than 0, gives a red badge with the total number of issues as the value. If access unavailable gives a grey badge.

Badge generation

Badges are generated with the help of the awesome Shields project. Badges look like

  • no vulnerabilities
  • 10 vulnerabilities
  • vulnerabilities unknown

snyk-badge's People

Contributors

samkit-jain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.