GithubHelp home page GithubHelp logo

isabella232 / action_scancode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zephyrproject-rtos/action_scancode

0.0 0.0 0.0 14 KB

License: Apache License 2.0

Dockerfile 2.96% Shell 15.43% Python 81.61%

action_scancode's Introduction

License Scanning Action

A Github action to scan code for license violations based on a configuration file per repository.

This actions uses a dedicated docker image available from:

https://github.com/zephyrproject-rtos/docker_scancode

Example workflow


name: Scancode

on: [pull_request]

jobs:
  scancode_job:
    runs-on: ubuntu-latest
    name: Scan code for licenses
    steps:
    - uses: actions/checkout@v1
    - name: Scan the code
      id: scancode
      uses: zephyrproject-rtos/action_scancode@v1
      with:
        directory-to-scan: 'scan/'
    - name: Artifact Upload
      uses: actions/upload-artifact@v1
      with:
        name: scancode
        path: ./artifacts

    - name: Verify
      run: |
        test ! -s ./artifacts/report.txt || (cat ./artifacts/report.txt && exit 1 )

The above example checks out the code and runs scancode on all new files being added by the pull request. New files are copied into the scan/ directory to avoid scanning of existing files in the repository.

Once scanning is complete, resulting files are uploaded as artifacts and available for further inspection.

The scanner generates a report that can be displayed to show the violations. Depending on your setup, you can either display it as part of the overall action log or you can upload it or put it in a comment in the pull-request.

Configuration

The action expects a configuration file under .github/ named license_config.yml. This file is used to filter the scanning results and identify violations based on whitelisted licenses and license categories.

license:
  main: apache-2.0
  category: Permissive
exclude:
  extensions:
    - yml
    - yaml
    - html
    - rst
    - conf
    - cfg
  langs:
    - HTML

The license section sets the main license for the repository and its category. Files licensed under the same category would be allowed in this case.

The exclude section is used to tell the scanner which extensions and content types to ignore when looking for license/copyright boilerplate.

action_scancode's People

Contributors

galak avatar nandojve avatar nashif avatar stephanosio 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.