From 2c5bb7196b4b9fe1f4e52e2462d83a8962bc63c3 Mon Sep 17 00:00:00 2001 From: as2024ad <183369419+as2024ad@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:37:01 +0000 Subject: [PATCH 1/6] Org and token. --- .github/workflows/sonarqube.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 12ab2326..0252c81f 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -56,17 +56,19 @@ jobs: - name: Build, Test and Analyze env: - SONAR_TOKEN_AS: ${{ secrets.SONAR_TOKEN }} + SONAR_TOKEN_AS: ${{ secrets.SONAR_TOKEN_AS }} run: | dotnet-sonarscanner begin \ - /k:"DFE-Digital_childrens-social-care-cpd" \ - /o:"dfe-digital" \ + # /k:"DFE-Digital_childrens-social-care-cpd" \ + # /o:"dfe-digital" \ + /k:"as2024ad_sfsw" \ + /o:"as2024ad" \ /d:sonar.qualitygate.wait=true \ /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml \ /d:sonar.exclusions="**/*.css,**/*.scss,**/Models/*,**/Program.cs,**/WebApplicationBuilderExtensions.cs,**/GraphQL/Queries/*,**/Contentful-Schema/migrations/*.cjs" \ /d:sonar.test.exclusions="Childrens-Social-Care-CPD-Tests/**/*,Terraform-bootstrap/Error-pages/*" \ - /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ + /d:sonar.token="${{ secrets.SONAR_TOKEN_AS }}" \ /d:sonar.host.url="https://sonarcloud.io" dotnet build --no-incremental dotnet-coverage collect --settings dotnet-cover-config.xml -f xml -o coverage.xml "dotnet test" - dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN_AS }}" From 5aaac5fc83b246205099dc1de5eddb17b1feff4b Mon Sep 17 00:00:00 2001 From: as2024ad <183369419+as2024ad@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:44:58 +0000 Subject: [PATCH 2/6] - --- .github/workflows/sonarqube.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 0252c81f..7f271d3f 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -59,8 +59,6 @@ jobs: SONAR_TOKEN_AS: ${{ secrets.SONAR_TOKEN_AS }} run: | dotnet-sonarscanner begin \ - # /k:"DFE-Digital_childrens-social-care-cpd" \ - # /o:"dfe-digital" \ /k:"as2024ad_sfsw" \ /o:"as2024ad" \ /d:sonar.qualitygate.wait=true \ From 777376f36673f16e8fdf8fa4d949fffe583e85a7 Mon Sep 17 00:00:00 2001 From: as2024ad <183369419+as2024ad@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:00:15 +0000 Subject: [PATCH 3/6] - --- .github/workflows/sonarqube.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 7f271d3f..d05ddf01 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -56,7 +56,7 @@ jobs: - name: Build, Test and Analyze env: - SONAR_TOKEN_AS: ${{ secrets.SONAR_TOKEN_AS }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_AS }} run: | dotnet-sonarscanner begin \ /k:"as2024ad_sfsw" \ From 7ded97f637b029566d0ede3fc5fe3843dc536006 Mon Sep 17 00:00:00 2001 From: as2024ad <183369419+as2024ad@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:13:42 +0000 Subject: [PATCH 4/6] - --- .github/workflows/sonarqube.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index d05ddf01..4bf1b94c 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -66,6 +66,7 @@ jobs: /d:sonar.exclusions="**/*.css,**/*.scss,**/Models/*,**/Program.cs,**/WebApplicationBuilderExtensions.cs,**/GraphQL/Queries/*,**/Contentful-Schema/migrations/*.cjs" \ /d:sonar.test.exclusions="Childrens-Social-Care-CPD-Tests/**/*,Terraform-bootstrap/Error-pages/*" \ /d:sonar.token="${{ secrets.SONAR_TOKEN_AS }}" \ + /d:sonar.project-key="${{ secrets.SONAR_PROJECT_KEY_AS }}" \ /d:sonar.host.url="https://sonarcloud.io" dotnet build --no-incremental dotnet-coverage collect --settings dotnet-cover-config.xml -f xml -o coverage.xml "dotnet test" From ea127bfc70dfada2e74492bea7e8c98052c997d2 Mon Sep 17 00:00:00 2001 From: as2024ad <183369419+as2024ad@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:30:30 +0000 Subject: [PATCH 5/6] - --- .github/workflows/sonarqube.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 4bf1b94c..75e84384 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -56,7 +56,7 @@ jobs: - name: Build, Test and Analyze env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_AS }} + SONAR_TOKEN_AS: ${{ secrets.SONAR_TOKEN_AS }} run: | dotnet-sonarscanner begin \ /k:"as2024ad_sfsw" \ From e9bdc67232f8f33144d0344026970deb6f4af796 Mon Sep 17 00:00:00 2001 From: as2024ad <183369419+as2024ad@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:54:33 +0000 Subject: [PATCH 6/6] - --- .github/workflows/sonarqube.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 75e84384..5cfe0026 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -1,12 +1,10 @@ name: Static code analysis on: - workflow_dispatch: - # push: - # branches: ["main", "release/**", "feature/**", "fix/**"] pull_request: - types: [opened, synchronize, reopened] - branches: ["next", "main", "release/**", "feature/**", "fix/**"] + branches: + - main + - next jobs: code-analysis: