https://github.com/codacy/codacy-cli-v2-action
https://github.com/codacy/codacy-cli-v2-action
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codacy/codacy-cli-v2-action
- Owner: codacy
- License: apache-2.0
- Created: 2024-10-01T13:34:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-05T17:46:52.000Z (about 1 year ago)
- Last Synced: 2025-02-16T11:27:59.577Z (11 months ago)
- Size: 115 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Codacy CLI V2 GitHub Action
[](https://app.codacy.com/gh/codacy/codacy-cli-v2-action/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
GitHub Action for running Codacy static analysis on [over 40 supported languages](https://docs.codacy.com/getting-started/supported-languages-and-tools/) and returning identified issues in the code.
[Codacy](https://www.codacy.com/) 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](https://github.com/codacy/codacy-cli-v2).
> [!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](https://github.com/codacy/codacy-cli-v2?tab=readme-ov-file#important-concepts) (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.

## Usage
```yaml
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. |