|
| 1 | +# action.yml |
| 2 | +name: "codacy-analysis-cli" |
| 3 | +author: "Codacy" |
| 4 | +description: "Execute Codacy code analysis using your remote Codacy configuration" |
| 5 | +branding: |
| 6 | + icon: 'check' |
| 7 | + color: 'gray-dark' |
| 8 | +inputs: |
| 9 | + verbose: |
| 10 | + required: false |
| 11 | + description: "Run with verbose output" |
| 12 | + project-token: |
| 13 | + required: false |
| 14 | + description: "A token to fetch your remote Codacy configuration for the project being analysed" |
| 15 | + codacy-api-base-url: |
| 16 | + required: false |
| 17 | + description: "Codacy's API URL, to retrieve the configuration." |
| 18 | + format: |
| 19 | + required: false |
| 20 | + description: "Format of the output file" |
| 21 | + output: |
| 22 | + required: false |
| 23 | + description: "Send analysis results to an output file" |
| 24 | + directory: |
| 25 | + required: false |
| 26 | + description: "The directory to be analysed" |
| 27 | + parallel: |
| 28 | + required: false |
| 29 | + description: "Number of tools to run in parallel" |
| 30 | + max-allowed-issues: |
| 31 | + required: false |
| 32 | + description: "Maximum number of issues allowed for the analysis to succeed" |
| 33 | + tool: |
| 34 | + required: false |
| 35 | + description: "The name of the tool to analyse the code" |
| 36 | + tool-timeout: |
| 37 | + required: false |
| 38 | + description: "Maximum time each tool has to execute" |
| 39 | + upload: |
| 40 | + required: false |
| 41 | + description: "Upload analysis results to Codacy" |
| 42 | + fail-if-incomplete: |
| 43 | + required: false |
| 44 | + description: "Fail the analysis if any tool fails to run" |
| 45 | + allow-network: |
| 46 | + required: false |
| 47 | + description: "Allow network access for tools" |
| 48 | + force-file-permissions: |
| 49 | + required: false |
| 50 | + description: "Force files to be readable by changing the permissions before running the analysis" |
| 51 | +runs: |
| 52 | + using: "composite" |
| 53 | + steps: |
| 54 | + - name: "Codacy CLI" |
| 55 | + shell: bash |
| 56 | + run: >- |
| 57 | + ${{ github.action_path }}/bin/codacy-analysis-cli.sh |
| 58 | + analyse |
| 59 | + $(if [ ${{ inputs.verbose }} = true ]; then echo "--verbose"; fi) |
| 60 | + $(if [ ${{ inputs.project-token }} ]; then echo "--project-token ${{ inputs.project-token }}"; fi) |
| 61 | + $(if [ ${{ inputs.codacy-api-base-url }} ]; then echo "--codacy-api-base-url ${{ inputs.codacy-api-base-url }}"; fi) |
| 62 | + $(if [ ${{ inputs.format }} ]; then echo "--format ${{ inputs.format }}"; fi) |
| 63 | + $(if [ ${{ inputs.output }} ]; then echo "--output ${{ inputs.output }}"; fi) |
| 64 | + $(if [ ${{ inputs.directory }} ]; then echo "--directory ${{ inputs.directory }}"; fi) |
| 65 | + $(if [ ${{ inputs.parallel }} ]; then echo "--parallel ${{ inputs.parallel }}"; fi) |
| 66 | + $(if [ ${{ inputs.max-allowed-issues }} ]; then echo "--max-allowed-issues ${{ inputs.max-allowed-issues }}"; fi) |
| 67 | + $(if [ ${{ inputs.tool }} ]; then echo "--tool ${{ inputs.tool }}"; fi) |
| 68 | + $(if [ ${{ inputs.tool-timeout }} ]; then echo "--tool-timeout ${{ inputs.tool-timeout }}"; fi) |
| 69 | + $(if [ ${{ inputs.upload }} = true ]; then echo "--upload"; fi) |
| 70 | + $(if [ ${{ inputs.fail-if-incomplete }} = true ]; then echo "--fail-if-incomplete"; fi) |
| 71 | + $(if [ ${{ inputs.allow-network }} = true ]; then echo "--allow-network"; fi) |
| 72 | + $(if [ ${{ inputs.force-file-permissions }} = true ]; then echo "--force-file-permissions"; fi) |
0 commit comments