Skip to content

codacy/codacy-cli-v2-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Codacy CLI V2 GitHub Action

Codacy Badge

GitHub Action for running Codacy static analysis on over 40 supported languages and returning identified issues in the code.


Codacy


Codacy is an automated code review tool that makes it easy to ensure your team is writing high-quality code by analyzing more than 40 programming languages such as PHP, JavaScript, Python, Java, and Ruby. Codacy allows you to define your own quality rules, code patterns and quality settings you'd like to enforce to prevent issues on your codebase.

About the CLI V2

The codacy-cli-v2 is a command-line tool for Codacy that supports analyzing code using ESLint and uploading the results in SARIF format to Codacy. It provides two main commands: analyze and upload.

Details can be found here.

Warning

Currently only the eslint tool is supported.

Requirements

  • A Repository on GitHub and Codacy

  • A project token

  • A valid codacy-cli-v2 configuration file (usually achieved by running codacy-cli-v2 init in the root of your repository)

  • If you want to upload the report to Codacy, you need to set the upload_report input to true and enable the flag "Run analysis on your build server" on the repository settings on Codacy.

    Codacy

Usage

steps:
# ...
    - name: Run Codacy CLI
        uses: codacy/codacy-cli-v2-action@main
        with:
          project_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
          tool: eslint
          upload_report: true
# ...

Inputs

Input Required Default Description
project_token Yes - The project token for your Codacy project.
tool Yes - The tool to use for analysis.
upload_report No false Whether to upload the report to Codacy.
sarif_file_path No "./report.sarif" The path to the SARIF file to upload.