Skip to content

Commit 5a8ce33

Browse files
committed
Add SonarCloud
1 parent db841bf commit 5a8ce33

File tree

3 files changed

+56
-1
lines changed

3 files changed

+56
-1
lines changed

.github/workflows/security.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Security
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
paths-ignore:
7+
- "*.md"
8+
pull_request:
9+
branches: ["master"]
10+
paths-ignore:
11+
- "*.md"
12+
schedule:
13+
- cron: "0 12 * * 0"
14+
workflow_dispatch:
15+
16+
jobs:
17+
sonarcloud:
18+
name: Run SonarCloud scanning
19+
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: read # Allows SonarCloud to decorate PRs with analysis results.
22+
steps:
23+
- uses: actions/setup-java@v4
24+
with:
25+
distribution: "temurin"
26+
java-version: "21" # SonarCloud requires v17 or higher.
27+
check-latest: true
28+
- uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis.
31+
- name: Install dependencies
32+
run: npm ci --no-fund
33+
- name: Test and coverage
34+
run: npm run test
35+
- name: SonarCloud Scan
36+
uses: sonarsource/sonarcloud-github-action@master
37+
if: success() || failure() # Run this step even if previous step failed.
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
41+
with:
42+
args: >
43+
-Dsonar.projectKey=jerone_turndown-plugin-github-code-snippet
44+
-Dsonar.organization=jerone
45+
-Dsonar.projectBaseDir=.
46+
-Dsonar.sources=./src/
47+
-Dsonar.tests=./test/

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sonarlint.connectedMode.project": {
3+
"connectionId": "jerone",
4+
"projectKey": "jerone_turndown-plugin-github-code-snippet"
5+
}
6+
}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# [turndown-plugin-github-code-snippet](https://github.com/jerone/turndown-plugin-github-code-snippet/)
22

3-
A [Turndown](https://github.com/mixmark-io/turndown) plugin to convert [GitHub code snippet in comments](https://help.github.com/articles/creating-a-permanent-link-to-a-code-snippet/) back into normal links. Useful for UserScripts.
3+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=jerone_turndown-plugin-github-code-snippet&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=jerone_turndown-plugin-github-code-snippet)
4+
5+
> A [Turndown](https://github.com/mixmark-io/turndown) plugin to convert [GitHub code snippet in comments](https://help.github.com/articles/creating-a-permanent-link-to-a-code-snippet/) back into normal links. Useful for UserScripts.
46
57
## Requirements
68

0 commit comments

Comments
 (0)