forcedotcom/Run Salesforce Code Analyzer
Scans your code for violations using Salesforce Code Analyzer, uploads results as an artifact, and creates a job summary.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| run-arguments | Specifies the flags passed to the `code-analyzer run` command. Default: "--view detail --output-file sfca_results.json" For a full list of valid flags for the `code-analyzer run` command, see the [code-analyzer Command Reference](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_code-analyzer_commands_unified.htm). The stdout text from the `code-analyzer run` command is written to the GitHub workflow run logs. Each output file specified by a `--output-file` (or `-f`) flag is included in the ZIP archive [GitHub workflow run artifact](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/downloading-workflow-artifacts) for you to download. | no | --view detail --output-file sfca_results.json |
| results-artifact-name | Specifies the name of the ZIP archive [GitHub workflow run artifact](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/downloading-workflow-artifacts) where the results output files are uploaded. Default: "salesforce-code-analyzer-results" | no | salesforce-code-analyzer-results |
| github-token | When this action is run against a pull request, you can provide a Github token, which is used to create a review of the pull request. The review specifies how many violations were found (both in the project as a whole and in changed files) and links to the action summary page. This token must have write permissions for pull requests. | no | — |
Outputs
| name | description |
|---|---|
| exit-code | The Salesforce Code Analyzer execution exit code. |
| num-violations | The total number of violations found across all files. |
| num-sev1-violations | The number of Critical (1) severity violations found across all files. |
| num-sev2-violations | The number of High (2) severity violations found across all files. |
| num-sev3-violations | The number of Medium (3) severity violations found across all files. |
| num-sev4-violations | The number of Low (4) severity violations found across all files. |
| num-sev5-violations | The number of Info (5) severity violations found across all files. |
| num-violations-in-changed-files | The total number of violations found in files changed by the pull request. Only available when running on a pull request with a github-token provided. |
| num-sev1-violations-in-changed-files | The number of Critical (1) severity violations found in files changed by the pull request. Only available when running on a pull request with a github-token provided. |
| num-sev2-violations-in-changed-files | The number of High (2) severity violations found in files changed by the pull request. Only available when running on a pull request with a github-token provided. |
| num-sev3-violations-in-changed-files | The number of Medium (3) severity violations found in files changed by the pull request. Only available when running on a pull request with a github-token provided. |
| num-sev4-violations-in-changed-files | The number of Low (4) severity violations found in files changed by the pull request. Only available when running on a pull request with a github-token provided. |
| num-sev5-violations-in-changed-files | The number of Info (5) severity violations found in files changed by the pull request. Only available when running on a pull request with a github-token provided. |
| review-id | If this action created a pull request review, this is its ID. |