Giter Site home page Giter Site logo

nhadiq / datadog-static-analyzer-github-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from datadog/datadog-static-analyzer-github-action

0.0 0.0 0.0 173 KB

Home Page: https://docs.datadoghq.com/continuous_integration/

License: Apache License 2.0

Shell 86.18% Dockerfile 13.82%

datadog-static-analyzer-github-action's Introduction

Datadog Static Analyzer Github Action

Overview

Run a Datadog Static Analysis job in your GitHub Action workflows.

Setup

To use Datadog Static Analysis, you need to add a static-analysis.datadog.yml file to your repository's root directory to specify which rulesets to use.

rulesets:
  - <ruleset-name>
  - <ruleset-name>

Example for Python

You can see an example for Python-based repositories:

rulesets:
  - python-code-style
  - python-best-practices
  - python-inclusive

Workflow

Create a file in .github/workflows to run a Datadog Static Analysis job.

The following is a sample workflow file.

on: [push]

jobs:
  check-quality:
    runs-on: ubuntu-latest
    name: Datadog Static Analyzer
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Check code meets quality standards
        id: datadog-static-analysis
        uses: DataDog/datadog-static-analyzer-github-action@v1
        with:
          dd_app_key: ${{ secrets.DD_APP_KEY }}
          dd_api_key: ${{ secrets.DD_API_KEY }}
          dd_service: "my-service"
          dd_env: "ci"
          dd_site: {{< region-param key="dd_site" code="true" >}}
          cpu_count: 2
          enable_performance_statistics: false

You must set your Datadog API and application keys as secrets in your GitHub repository whether at the organization or repository level. For more information, see API and Application Keys.

Inputs

You can set the following parameters for Static Analysis.

Name Description Required Default
dd_api_key Your Datadog API key. This key is created by your Datadog organization and should be stored as a secret. Yes
dd_app_key Your Datadog application key. This key is created by your Datadog organization and should be stored as a secret. Yes
dd_service The service you want your results tagged with. Yes
dd_env The environment you want your results tagged with. Datadog recommends using ci as the value for this input. No none
dd_site The Datadog site to send information to. No datadoghq.com
cpu_count Set the number of CPUs used to by the analyzer. No 2
enable_performance_statistics Get the execution time statistics for analyzed files. No false
debug Lets the analyzer print additional logs useful for debugging. To enable, set to yes. No no
subdirectory The subdirectory path the analysis should be limited to. The path is relative to the root directory of the repository. No
architecture The CPU architecture to use for the analyzer. Supported values are x86_64 and aarch64. No x86_64

Further Reading

Additional helpful documentation, links, and articles:

datadog-static-analyzer-github-action's People

Contributors

alai97 avatar dastrong avatar drodriguezhdez avatar juli1 avatar markazerdd avatar zetechmoy 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.