Skip to content

Commit 305cb4a

Browse files
authored
feat: add SonarCloud implementation (#42)
* add devsecops_pipeline.py * add devsecops-pipeline workflow * replace sonarqube with bandit * edit cron job * add comment for the cron job * add Git Guardian workflow * edit Git Guardian workflow * edit Git Guardian workflow * edit Git Guardian workflow * edit Git Guardian workflow * edit Git Guardian workflow * edit Git Guardian workflow * edit Git Guardian workflow * edit Git Guardian workflow * edit Git Guardian workflow * edit README file * edit DevSecOps pipeline * edit release badge * add .gitignore file * add PR Title Linter * add status badge for PR Linter * add SonarCloud implementation * edit sonar-project.properties * add SonarCloud badge
1 parent 94c8157 commit 305cb4a

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: SonarCloud Analysis
2+
3+
on:
4+
# Trigger analysis when pushing to your main branches, and when creating a pull request.
5+
push:
6+
branches:
7+
- main
8+
- dev
9+
pull_request:
10+
types: [opened, synchronize, reopened]
11+
12+
jobs:
13+
sonar-scan:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: '17'
24+
distribution: 'temurin'
25+
java-package: 'jdk'
26+
27+
- name: SonarCloud Scan
28+
uses: sonarsource/sonarcloud-github-action@v3 # Ex: v2.1.0, See the latest version at https://github.com/marketplace/actions/sonarcloud-scan
29+
env:
30+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

β€ŽREADME.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# $\color{Cerulean}{Python\}$ $\color{Goldenrod}{Examples\}$
2-
[![GitGuardian scan](https://github.com/meleksabit/My-Python-Examples/actions/workflows/gitguardian.yml/badge.svg)](https://github.com/meleksabit/My-Python-Examples/actions/workflows/gitguardian.yml)
2+
[![SonarCloud Analysis](https://github.com/meleksabit/My-Python-Examples/actions/workflows/sonarcloud.yml/badge.svg)](https://github.com/meleksabit/My-Python-Examples/actions/workflows/sonarcloud.yml) [![GitGuardian scan](https://github.com/meleksabit/My-Python-Examples/actions/workflows/gitguardian.yml/badge.svg)](https://github.com/meleksabit/My-Python-Examples/actions/workflows/gitguardian.yml)
33
[![CodeQL](https://github.com/meleksabit/My-Python-Examples/actions/workflows/codeql.yml/badge.svg)](https://github.com/meleksabit/My-Python-Examples/actions/workflows/codeql.yml)
44
[![Bandit](https://github.com/meleksabit/My-Python-Examples/actions/workflows/bandit.yml/badge.svg)](https://github.com/meleksabit/My-Python-Examples/actions/workflows/bandit.yml)
55
[![DevSecOps Pipeline](https://github.com/meleksabit/My-Python-Examples/actions/workflows/devsecops-pipeline.yml/badge.svg)](https://github.com/meleksabit/My-Python-Examples/actions/workflows/devsecops-pipeline.yml) [![PR Title Check](https://github.com/meleksabit/My-Python-Examples/actions/workflows/pr-title-linter.yml/badge.svg)](https://github.com/meleksabit/My-Python-Examples/actions/workflows/pr-title-linter.yml) [![GitHub Release](https://img.shields.io/github/v/release/meleksabit/My-Python-Examples)](https://github.com/meleksabit/My-Python-Examples/releases)

β€Žsonar-project.propertiesβ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Required project settings
2+
sonar.organization=meleksabit
3+
sonar.projectKey=meleksabit_My-Python-Examples
4+
sonar.projectName=My-Python-Examples
5+
sonar.host.url=https://sonarcloud.io
6+
7+
# Optional configuration
8+
sonar.sources=.
9+
sonar.language=python # (or your project's primary language)
10+
sonar.sourceEncoding=UTF-8

0 commit comments

Comments
Β (0)