Skip to content

Commit

Permalink
Update action.yml - renamed matrics to metrics (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
gitricko authored Jul 9, 2024
1 parent a69e0c2 commit 8130e1f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
echo "# of vulnerabilities = ${VULN}"
[ "${VULN}" -eq "0" ]
echo "Checking for any issues <= 2 in Sonar Metrics JSON"
echo "Checking for any issues <= 3 in Sonar Metrics JSON"
ISSUES=$(cat ./blahblah.json | jq -r '.component.measures[] | select(.metric == "open_issues").value')
echo "# of issues = ${ISSUES}"
[ "${ISSUES}" -le 2 ]
[ "${ISSUES}" -le 3 ]
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![GitHub Release](https://img.shields.io/github/v/release/gitricko/sonarless)
![GitHub commits since latest release](https://img.shields.io/github/commits-since/gitricko/sonarless/latest)

# Sonarless v1.1
# Sonarless v1.2

This developer-friendly CLI and GitHub Action enable SonarQube scanning for your repository without the need for a dedicated hosted SonarQube server. It starts a SonarQube Docker instance, allowing developers to scan code, check results, and generate a JSON metrics file for automation. This ensures you can easily assess and maintain the quality of your code.

Expand Down Expand Up @@ -62,7 +62,7 @@ This CLI works perfectly with Github CodeSpace

<!-- start usage -->
```yaml
- uses: gitricko/sonarless@v1.1
- uses: gitricko/sonarless@v1.2
with:
# Folder path to scan from git-root
# Default: .
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
uses: actions/checkout@v4

- name: Sonarless Scan
uses: gitricko/sonarless@v1.1
uses: gitricko/sonarless@v1.2
```
## Scan particular folder from git root directory
Expand All @@ -114,7 +114,7 @@ jobs:
uses: actions/checkout@v4

- name: Sonarless Scan
uses: gitricko/sonarless@v1.1
uses: gitricko/sonarless@v1.2
with:
sonar-source-path: 'src'
```
Expand All @@ -130,7 +130,7 @@ jobs:
uses: actions/checkout@v4

- name: Sonarless Scan
uses: gitricko/sonarless@v1.1
uses: gitricko/sonarless@v1.2
with:
sonar-source-path: 'src'
sonar-metrics-path: './sonar-mymetrics.json'
Expand All @@ -154,7 +154,7 @@ jobs:
uses: actions/checkout@v4
- name: Sonarless Scan
uses: gitricko/sonarless@v1.1
uses: gitricko/sonarless@v1.2
with:
sonar-instance-port: '1234'
```
Expand Down
16 changes: 9 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@ author: "gitricko"
inputs:
sonar-project-name:
description: "SonarQube Project Name"
required: true
required: false
default: ${{github.event.repository.name}}
sonar-project-key:
description: "SonarQube Project Key"
required: true
required: false
default: ${{github.event.repository.name}}
sonar-source-path:
description: "SonarQube Source Path from Git Root"
required: true
default: .
required: false
sonar-metrics-path:
description: "SonarQube Metrics JSON Path from Git Root"
required: true
default: ./sonar-matrics.json
required: false
sonar-instance-port:
description: "SonarQube Instance Port"
required: false
Expand Down Expand Up @@ -52,4 +50,8 @@ runs:
SONAR_SOURCE_PATH: ${{inputs.sonar-source-path}}
SONAR_METRICS_PATH: ${{inputs.sonar-metrics-path}}
SONAR_INSTANCE_PORT: ${{ inputs.sonar-instance-port }}
SONAR_GITROOT: ${{ github.workspace }}
SONAR_GITROOT: ${{ github.workspace }}

branding:
icon: "check-circle"
color: "green"
2 changes: 1 addition & 1 deletion makefile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,4 @@ function uninstall() {
rm -rf "${HOME}/.${CLI_NAME}"
}

"$*"
$*

0 comments on commit 8130e1f

Please sign in to comment.