From 79a5047100c0a8839bffac3a62f965c7a04f8b75 Mon Sep 17 00:00:00 2001 From: Andy Bridges Date: Fri, 25 Oct 2024 09:43:48 +0100 Subject: [PATCH 1/5] add sonarcloud --- .github/workflows/main.yml | 7 +++++++ .github/workflows/sonarcloud.yml | 20 ++++++++++++++++++++ sonar-project.properties | 15 +++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 .github/workflows/sonarcloud.yml create mode 100644 sonar-project.properties diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0577bbc909b..a1310370222 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,6 +46,12 @@ jobs: SENTRY_KEY: ${{ secrets.SENTRY_KEY }} GF_SURVEY_KEY: ${{ secrets.GF_SURVEY_KEY }} + sonarcloud: + name: Sonarcloud + uses: ./.github/workflows/sonarcloud.yml + secrets: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + all-jobs-completed: name: All jobs completed runs-on: ubuntu-latest @@ -54,6 +60,7 @@ jobs: - build - lint - case + - sonarcloud outputs: PASSED: ${{ steps.set-output.outputs.PASSED }} steps: diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 00000000000..b2471100348 --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,20 @@ +name: Sonarcloud + +on: + workflow_call: + secrets: + SONAR_TOKEN: + required: true + +jobs: + sonarcloud: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@5875562561d22a34be0c657405578705a169af6c + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000000..f74d299d524 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,15 @@ +# Unique sonar data by project +sonar.projectKey=metamask-docs +sonar.organization=metamask + +# Source +sonar.sources=src +# sonar.exclusions= + +# Tests +# sonar.tests=src,test +# sonar.test.inclusions=**/*.test.ts +# sonar.javascript.lcov.reportPaths=coverage/coverage/unit/lcov.info + +# Block PRs with quality gate failures +sonar.qualitygate.wait=false \ No newline at end of file From 4efe11b3f88bb946864a657a4b85cb87c538a817 Mon Sep 17 00:00:00 2001 From: Andy Bridges Date: Tue, 29 Oct 2024 10:34:40 +0000 Subject: [PATCH 2/5] update sonarcloud action --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index b2471100348..da98d0d7295 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@5875562561d22a34be0c657405578705a169af6c + uses: SonarSource/sonarcloud-github-action@4b4d7634dab97dcee0b75763a54a6dc92a9e6bc1 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 37b2c5b4a1c21bc77680c2d7181e301a98a1ea76 Mon Sep 17 00:00:00 2001 From: Andy Bridges Date: Tue, 29 Oct 2024 11:09:44 +0000 Subject: [PATCH 3/5] remove GITHUB_TOKEN --- .github/workflows/sonarcloud.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index da98d0d7295..d6014f1e661 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -16,5 +16,4 @@ jobs: - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@4b4d7634dab97dcee0b75763a54a6dc92a9e6bc1 env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file From 850e5fdccad68897fb22704f1e299b3bc219920a Mon Sep 17 00:00:00 2001 From: Andy Bridges Date: Wed, 6 Nov 2024 08:55:54 +0000 Subject: [PATCH 4/5] chore: update sonarcloud action --- .github/workflows/sonarcloud.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index d6014f1e661..55a58a6195e 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -14,6 +14,7 @@ jobs: with: fetch-depth: 0 - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@4b4d7634dab97dcee0b75763a54a6dc92a9e6bc1 + uses: SonarSource/sonarcloud-github-action@383f7e52eae3ab0510c3cb0e7d9d150bbaeab838 env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 7f53ab1a8c0f85f0995f8a2d6fbff33b0002cf7b Mon Sep 17 00:00:00 2001 From: Joshua Fernandes Date: Thu, 7 Nov 2024 08:59:47 +1000 Subject: [PATCH 5/5] remove dependency per discussion and request from @AndyMBridges and @409h --- .github/workflows/dependency_review.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/dependency_review.yml diff --git a/.github/workflows/dependency_review.yml b/.github/workflows/dependency_review.yml deleted file mode 100644 index 5104c94c04e..00000000000 --- a/.github/workflows/dependency_review.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Check file name case - -on: - pull_request: - branches: - - main - -jobs: - case: - name: Check for licences not being allowed - runs-on: ubuntu-latest - strategy: - matrix: - folder: ["docs"] - permissions: - contents: read - steps: - - uses: actions/checkout@v3 - - - name: Dependency review - uses: ConsenSys/docs-gha/dependency-review@main - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}