This is a GitHub Action for invoking the Codacy Analysis CLI and returning identified issues in the code.
The following is an example GitHub Action workflow that uses the Codacy Analysis CLI to analyze each commit and pull request.
name: codacy-analysis-cli
on: ["push"]
jobs:
codacy-analysis-cli:
runs-on: ubuntu-latest
name: Codacy Analysis CLI
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Run codacy-analysis-cli
uses: codacy/codacy-analysis-cli-action@masterRunning the action with the default configurations will:
- Analyze the current commit or pull request by running all supported static code analysis tools, with their default configurations, for the languages you are using.
- Print analysis results on the console, visible on the GitHub Action's workflow panel.
- Fail the workflow if at least one issue is found in your code.
Read the next section to learn how you can further configure this action.
This action supports all Codacy Analysis CLI configuration options, with the following exceptions:
--commit-uuid-- Not supported. The action will always analyze the commit that triggered it.--api-token,--username, and--project-- Not supported. Use--project-tokeninstead.
The command validate-configuration is also not supported.
When using --project-token make sure that you use GitHub security features
to avoid committing the secret token to your repository. For example, if you store your Codacy project
token in GitHub, this is how you would use it in the action workflow:
# ...
uses: codacy/codacy-analysis-cli-action@master
with:
project-token: ${{ secrets.<PROJECT_TOKEN_NAME> }}
# ...We love contributions, feedback, and bug reports. If you run into issues while running this action, open an issue in this repository.
Codacy is an Automated Code Review Tool that monitors your technical debt, helps you improve your code quality, teaches best practices to your developers, and helps you save time in Code Reviews.
- Identify new Static Analysis issues
- Commit and Pull Request Analysis with GitHub, BitBucket/Stash, GitLab (and also direct git repositories)
- Auto-comments on Commits and Pull Requests
- Integrations with Slack, HipChat, Jira, YouTrack
- Track issues in Code Style, Security, Error Proneness, Performance, Unused Code and other categories
Codacy also helps keep track of Code Coverage, Code Duplication, and Code Complexity.
Codacy supports PHP, Python, Ruby, Java, JavaScript, and Scala, among others.
Codacy is free for Open Source projects.