Skip to content

Commit

Permalink
Set sonar-scanner 4.6.2.2472 and added full example to readme (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegofcornejo authored Feb 18, 2022
1 parent 5a67bf2 commit 8f1c390
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 30 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@ name: CI
on:
push:
branches:
- master
- master
pull_request:
branches:
- master
- master

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Setup sonarqube
uses: ./
- name: run sonarqube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sonar-scanner
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.organization=1corp
-Dsonar.host.url=https://sonarcloud.io/
-Dsonar.projectKey=sonar-scanner-action
- uses: actions/checkout@v1
- name: Setup sonarqube
uses: ./
- name: run sonarqube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sonar-scanner
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.organization=1corp
-Dsonar.host.url=https://sonarcloud.io/
-Dsonar.projectKey=sonar-scanner-action
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,26 @@ This action downloads given version of sonar-scanner and adds it to PATH.

### `version`

**Required** sonar-scanner cli version. List of available versions: https://github.com/SonarSource/sonar-scanner-cli/releases. Default `4.2.0.1873`.
**Required** sonar-scanner cli version. List of available versions: https://github.com/SonarSource/sonar-scanner-cli/releases. Default `4.6.2.2472`.

## Example usage
## Full Example usage

```yaml
- name: Setup sonarqube
uses: warchant/setup-sonar-scanner@v3
- name: Run sonarqube
env:
# to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sonar-scanner
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.organization=1corp
-Dsonar.host.url=https://sonarcloud.io/
-Dsonar.projectKey=sonar-scanner-action
```
on: push
name: SonarQube
jobs:
sonarQubeTrigger:
name: SonarQube Trigger
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup sonarqube
uses: warchant/setup-sonar-scanner@v3
- name: Run sonarqube
run: sonar-scanner
-Dsonar.organization=1corp
-Dsonar.projectKey=Claro-Club-Mobile
-Dsonar.sources=$GITHUB_WORKSPACE
-Dsonar.host.url=${{ secrets.SONAR_URL }}
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
```
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ inputs:
description: 'Sonar-scanner version'
required: true
# https://github.com/SonarSource/sonar-scanner-cli/releases
default: '4.2.0.1873'
default: '4.6.2.2472'
branding:
icon: 'check'
color: 'black'
color: 'gray-dark'
runs:
using: 'node12'
main: 'dist/index.js'

0 comments on commit 8f1c390

Please sign in to comment.