Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Use latest Codacy CLI version [CY-2939] #11

Merged
merged 2 commits into from
Oct 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)