Skip to content

Commit

Permalink
Merge pull request #11 from codacy/am/feat/use-new-cli-CY2939
Browse files Browse the repository at this point in the history
feature: Use latest Codacy CLI version [CY-2939]
  • Loading branch information
afsmeira committed Oct 12, 2020
2 parents 3f1d0df + 99e77c7 commit d840f88
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,31 @@ inputs:
force-file-permissions:
required: false
description: "Force files to be readable by changing the permissions before running the analysis"
gh-code-scanning-compat:
required: false
description: >-
Reduce issue severity by one level, for non-security issues, for compatibility with GitHub's code scanning feature.
This option will only have an effect when used in conjunction with '--format sarif'.
runs:
using: "composite"
steps:
- name: "Set Codacy CLI version"
shell: bash
run: echo "CODACY_ANALYSIS_CLI_VERSION=4.0.0" >> $GITHUB_ENV
- name: "Set script path environment variable"
shell: bash
run: echo "::set-env name=CLI_SCRIPT_PATH::${{ github.action_path }}/codacy-analysis-cli.sh"
run: echo "CLI_SCRIPT_PATH=${{ github.action_path }}/codacy-analysis-cli.sh" >> $GITHUB_ENV
- name: "Download Codacy CLI script"
shell: bash
run: wget -O - https://raw.githubusercontent.com/codacy/codacy-analysis-cli/3.6.0/bin/codacy-analysis-cli.sh > ${{ env.CLI_SCRIPT_PATH }}
run: wget -O - https://raw.githubusercontent.com/codacy/codacy-analysis-cli/${{ env.CODACY_ANALYSIS_CLI_VERSION }}/bin/codacy-analysis-cli.sh > ${{ env.CLI_SCRIPT_PATH }}
- name: "Change Codacy CLI script permissions"
shell: bash
run: chmod +x ${{ env.CLI_SCRIPT_PATH }}
- name: "Run Codacy CLI"
shell: bash
run: >-
${{ env.CLI_SCRIPT_PATH }}
analyse
analyze
$(if [ ${{ inputs.verbose }} = true ]; then echo "--verbose"; fi)
$(if [ ${{ inputs.project-token }} ]; then echo "--project-token ${{ inputs.project-token }}"; fi)
$(if [ ${{ inputs.codacy-api-base-url }} ]; then echo "--codacy-api-base-url ${{ inputs.codacy-api-base-url }}"; fi)
Expand All @@ -78,4 +86,5 @@ runs:
$(if [ ${{ inputs.upload }} = true ]; then echo "--upload"; fi)
$(if [ ${{ inputs.fail-if-incomplete }} = true ]; then echo "--fail-if-incomplete"; fi)
$(if [ ${{ inputs.allow-network }} = true ]; then echo "--allow-network"; fi)
$(if [ ${{ inputs.force-file-permissions }} = true ]; then echo "--force-file-permissions"; fi)
$(if [ ${{ inputs.force-file-permissions }} = true ]; then echo "--force-file-permissions"; fi)
$(if [ ${{ inputs.gh-code-scanning-compat }} = true ]; then echo "--gh-code-scanning-compat"; fi)

0 comments on commit d840f88

Please sign in to comment.