Skip to content

Commit

Permalink
chore: add sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwynr committed Feb 1, 2024
1 parent 49dbfbd commit 5bb07de
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 61 deletions.
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
branches: ["main"]
pull_request:
branches: ["main"]
types: [opened, synchronize, reopened]
schedule:
- cron: "23 10 * * 4"

Expand Down
67 changes: 34 additions & 33 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,42 @@
name: ESLint

on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '40 15 * * 0'
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
types: [opened, synchronize, reopened]
schedule:
- cron: "40 15 * * 0"

jobs:
eslint:
name: Run eslint scanning
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v3
eslint:
name: Run eslint scanning
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install ESLint
run: |
npm install [email protected]
npm install @microsoft/[email protected]
- name: Install ESLint
run: |
npm install [email protected]
npm install @microsoft/[email protected]
- name: Run ESLint
run: npx eslint src/**/*
--config .eslintrc
--ext .js,.jsx,.ts,.tsx
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true
- name: Run ESLint
run: npx eslint src/**/*
--config .eslintrc
--ext .js,.jsx,.ts,.tsx
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: eslint-results.sarif
wait-for-processing: true
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: eslint-results.sarif
wait-for-processing: true
55 changes: 28 additions & 27 deletions .github/workflows/njsscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,35 @@
name: njsscan sarif

on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '36 1 * * 6'
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
types: [opened, synchronize, reopened]
schedule:
- cron: "36 1 * * 6"

permissions:
contents: read
contents: read

jobs:
njsscan:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
runs-on: ubuntu-latest
name: njsscan code scanning
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: nodejsscan scan
id: njsscan
uses: ajinabraham/njsscan-action@7237412fdd36af517e2745077cedbf9d6900d711
with:
args: 'src/ --sarif --output results.sarif || true'
- name: Upload njsscan report
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
njsscan:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
runs-on: ubuntu-latest
name: njsscan code scanning
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: nodejsscan scan
id: njsscan
uses: ajinabraham/njsscan-action@7237412fdd36af517e2745077cedbf9d6900d711
with:
args: "src/ --sarif --output results.sarif || true"
- name: Upload njsscan report
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
13 changes: 13 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sonar.projectKey=FilenCloudDienste_filen-sdk-ts
sonar.organization=filen

# This is the name and version displayed in the SonarCloud UI.
sonar.projectName=filen-sdk-ts
#sonar.projectVersion=1.0


# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
sonar.sources=src/

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
3 changes: 2 additions & 1 deletion src/reactNative/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* eslint-disable no-var */

export {}

// Global declarations for the ReactNative <-> Node.JS bridge
// Keep it in sync (only the needed functions) with the actual app at all times

declare global {
// eslint-disable-next-line no-var
var nodeThread: {
encryptData: (params: { base64: string; key: string }) => Promise<Uint8Array>
decryptData: (params: { base64: string; key: string; version: number }) => Promise<Uint8Array>
Expand Down

0 comments on commit 5bb07de

Please sign in to comment.