GitHub Action for running Codacy static analysis on over 40 supported languages and returning identified issues in the code.
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.
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.
-
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 totrue
and enable the flag "Run analysis on your build server" on the repository settings on Codacy.
steps:
# ...
- name: Run Codacy CLI
uses: codacy/codacy-cli-v2-action@main
with:
project_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
tool: eslint
upload_report: true
# ...
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. |