Skip to content

Commit 72effd1

Browse files
ppvgrandh1r
andauthored
docs: update readme (#5)
* docs: update readme * docs: simplify readme intro * docs: fix typo Co-authored-by: Randh1r Gulraj <randhir.gulraj@the-future-group.com> --------- Co-authored-by: Randh1r Gulraj <randhir.gulraj@the-future-group.com>
1 parent 164e1e7 commit 72effd1

1 file changed

Lines changed: 22 additions & 36 deletions

File tree

README.md

Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,46 @@
11
# SonarQube Scanner GitHub Action
22

33
This repository provides a reusable GitHub Action for running SonarQube scans in GitHub Workflows.
4-
It is designed to standardize the logic around the original [SonarQube Scanner Action](https://github.com/SonarSource/sonarqube-scan-action),
5-
automatically handling details such as providing the correct branch name for pull requests and checking if the pull request is a fork.
6-
7-
## Features
8-
9-
- Standardizes the [SonarQube Scanner Action](https://github.com/SonarSource/sonarqube-scan-action) for consistent usage across projects
10-
- Ability to configure the project base directory for SonarQube analysis
11-
- Provide branch name to the scan action when running on pull requests
12-
- Prevents the scan action from running on pull requests from forks by default
4+
It wraps the official [SonarQube Scanner Action](https://github.com/SonarSource/sonarqube-scan-action) to standardize details such as providing the correct branch name for pull requests and checking if the pull request is made from a fork.
135

146
## Usage
157

16-
Here is a basic example of how you can integrate it in your project.
17-
18-
<details>
19-
<summary>Example workflow</summary>
20-
21-
This workflow is executed automatically on push to the main branch, on a pull request and can also be executed manually from the actions tab `workflow_dispatch`.
22-
23-
In the code below you need to replace `${{ secrets.SONAR_TOKEN }}` with the secret that contains the SonarQube token you want to use.
8+
To use the action, add it to a workflow in your repository:
249

2510
```yml
2611
name: Run SonarCloud scanner
2712

2813
on:
29-
workflow_dispatch:
30-
pull_request:
31-
push:
32-
branches:
33-
- main
14+
workflow_dispatch:
15+
pull_request:
16+
push:
17+
branches:
18+
- main
3419

3520
jobs:
3621
sonarcloud-scanner:
3722
runs-on: ubuntu-latest
3823
steps:
39-
- name: Checkout repository
40-
uses: actions/checkout@v4
41-
42-
# Using the action
43-
- name: Install dependencies
44-
uses: minvws/action-sonarcube-cloud@v1
45-
with:
46-
sonar-token: ${{ secrets.SONAR_TOKEN }}
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Run SonarQube scan
28+
uses: minvws/action-sonarcube-cloud@v1
29+
with:
30+
sonar-token: ${{ secrets.SONAR_TOKEN }}
4731
```
4832
49-
</details>
33+
Make sure to add the `SONAR_TOKEN` secret to your repository's configuration. See [Using secrets in GitHub Actions](https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets).
34+
35+
In this basic example, the workflow is executed automatically on push to the `main` branch and on any pull request. And thanks to the `workflow_dispatch` trigger it can also be executed manually from the repository's Actions tab.
5036

5137
### Configuration
5238

53-
The action has inputs. The inputs are:
39+
The action has the following inputs:
5440

55-
- sonar-token: the SonarQube token
56-
- project-base-dir: set the sonar.projectBaseDir analysis property, default is `.`
57-
- allow-run-on-fork: allow SonarQube scan to run on pull requests from forks (default: false)
41+
- `sonar-token`: the SonarQube token.
42+
- `project-base-dir`: set the sonar.projectBaseDir analysis property, default is `.`.
43+
- `allow-run-on-fork`: allow SonarQube scan to run on pull requests from forks (default: false).
5844

5945
## Contribution
6046

@@ -65,7 +51,7 @@ Git commits must be signed. Please check the [Signing commits documentation on G
6551

6652
## License
6753

68-
This repository is released under the EUPL 1.2 license. [See LICENSE](LICENSE.txt) for details.
54+
This repository is released under the EUPL 1.2 license. [See LICENSE.txt](./LICENSE.txt) for details.
6955

7056
## Part of iCore
7157

0 commit comments

Comments
 (0)