-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
45 lines (43 loc) · 1.65 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: 'SonarQube Scanner-Linux'
author: 'Jim Seiwert'
description: 'Scans your code using the sonarqube batch file'
branding:
icon: 'activity'
color: 'blue'
inputs:
host-url: # id of input
description: 'URL to SonarQube'
required: true
token: # id of input
description: 'SonarQube token'
required: true
project-key: # id of input
description: 'The name of the SonarQube project'
required: true
project-name: # id of input
description: 'The name of the SonarQube project'
required: true
sq-version: # id of input
description: 'The version of the SonarQube scanner'
required: true
default: "4.6.1.2450"
runs:
using: "composite"
steps:
- name: Install the required packages
run: |
echo "Getting zip tool"
sudo apt-get install zip unzip
echo "Creating directory"
mkdir ${{ github.action_path }}/sq_download -p
cd ${{ github.action_path }}/sq_download
echo "Downloading scanner"
wget -q https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ inputs.sq-version }}-linux.zip
echo "UnZip Scanner"
unzip -q sonar-scanner-cli-${{ inputs.sq-version }}-linux.zip
mv sonar-scanner-${{ inputs.sq-version }}-linux ${{ github.action_path }}/sq
cd ${{ github.action_path }}/sq
shell: bash
- name: Scan
run: ${{ github.action_path }}/sq/bin/sonar-scanner --define sonar.host.url="${{ inputs.host-url }}" --define sonar.login="${{ inputs.token }}" --define sonar.projectKey="${{ inputs.project-key }}" --define sonar.projectName="${{ inputs.project-name }}"
shell: bash