From 8365dc663da3ac4ef49c21a571564244d3e4681a Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 06:02:35 -0500 Subject: [PATCH 01/18] Splitting JSON for possibly easier processing for MD conversion. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index ca19fc2d..8a1affcd 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -89,13 +89,14 @@ jobs: sed -E 's/([a-zA-Z0-9_]+):/\\"\1\\":/g; s/:([^",{}\[\]]+)/:"\1"/g' qg_input.txt > qg_raw.json jq -c '.' qg_raw.json > qg_fixed_json.json cat qg_fixed_json.json - echo "qg_fixed_json=$(cat qg_fixed_json.json)" >> $GITHUB_ENV + projstatus=$(jq -r '.projectStatus.status' fixed.json) + caycStatus=$(jq -r '.projectStatus.caycStatus' fixed.json) + conditions=$(jq -c '.projectStatus.conditions' fixed.json) - - name: Convert JSON report to markdown - id: convert-json-to-md - uses: parkerbxyz/json-to-markdown-table@v1.1.2 - with: - json: ${{ env.qg_fixed_json }} + echo "status=${status}" >> $GITHUB_OUTPUT + echo "caycStatus=${caycStatus}" >> $GITHUB_OUTPUT + echo "conditions=${conditionCount}" >> $GITHUB_OUTPUT + echo "qg_fixed_json=$(cat qg_fixed_json.json)" >> $GITHUB_ENV - name: Verify markdown output run: | From 0ff3bf80decd7ead3972bb39af5cb869b6c5e05a Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 06:08:08 -0500 Subject: [PATCH 02/18] Splitting JSON for possibly easier processing for MD conversion. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index 8a1affcd..a6370f98 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -89,9 +89,9 @@ jobs: sed -E 's/([a-zA-Z0-9_]+):/\\"\1\\":/g; s/:([^",{}\[\]]+)/:"\1"/g' qg_input.txt > qg_raw.json jq -c '.' qg_raw.json > qg_fixed_json.json cat qg_fixed_json.json - projstatus=$(jq -r '.projectStatus.status' fixed.json) - caycStatus=$(jq -r '.projectStatus.caycStatus' fixed.json) - conditions=$(jq -c '.projectStatus.conditions' fixed.json) + projstatus=$(jq -r '.projectStatus.status' qg_fixed_json.json) + caycStatus=$(jq -r '.projectStatus.caycStatus' qg_fixed_json.json) + conditions=$(jq -c '.projectStatus.conditions' qg_fixed_json.json) echo "status=${status}" >> $GITHUB_OUTPUT echo "caycStatus=${caycStatus}" >> $GITHUB_OUTPUT From 49f002d80263d4bd29a9e1be92660772a0d43f76 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 06:52:29 -0500 Subject: [PATCH 03/18] Forgot to add the actual conversion step. Derp. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index a6370f98..bea6592e 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -93,11 +93,17 @@ jobs: caycStatus=$(jq -r '.projectStatus.caycStatus' qg_fixed_json.json) conditions=$(jq -c '.projectStatus.conditions' qg_fixed_json.json) - echo "status=${status}" >> $GITHUB_OUTPUT + echo "projstatus=${projstatus}" >> $GITHUB_OUTPUT echo "caycStatus=${caycStatus}" >> $GITHUB_OUTPUT - echo "conditions=${conditionCount}" >> $GITHUB_OUTPUT + echo "conditions=${conditions}" >> $GITHUB_OUTPUT echo "qg_fixed_json=$(cat qg_fixed_json.json)" >> $GITHUB_ENV + - name: Convert JSON to Markdown Table + id: convert-json-to-md + uses: parkerbxyz/json-to-markdown-table@v1.1.2 + with: + json: ${{ steps.json-cleansing.outputs.projstatus }} + - name: Verify markdown output run: | echo ${{ steps.convert-json-to-md.outputs.table }} From a5566dd14cc36314dc5f3a206c88d89ab433031d Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 06:58:00 -0500 Subject: [PATCH 04/18] More chai needed... --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index bea6592e..15ee9e50 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -102,7 +102,7 @@ jobs: id: convert-json-to-md uses: parkerbxyz/json-to-markdown-table@v1.1.2 with: - json: ${{ steps.json-cleansing.outputs.projstatus }} + json: ${{ steps.json-cleanup.outputs.projstatus }} - name: Verify markdown output run: | From 380d5e0cfdcf77439f4be16201791fd6ccc9615f Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 07:04:26 -0500 Subject: [PATCH 05/18] ... --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index 15ee9e50..985ea015 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -88,11 +88,12 @@ jobs: echo '${{ steps.quality-gate-check.outputs.quality-gate-result }}' > qg_input.txt sed -E 's/([a-zA-Z0-9_]+):/\\"\1\\":/g; s/:([^",{}\[\]]+)/:"\1"/g' qg_input.txt > qg_raw.json jq -c '.' qg_raw.json > qg_fixed_json.json - cat qg_fixed_json.json projstatus=$(jq -r '.projectStatus.status' qg_fixed_json.json) + echo "${projstatus}" caycStatus=$(jq -r '.projectStatus.caycStatus' qg_fixed_json.json) + echo "${caycStatus}" conditions=$(jq -c '.projectStatus.conditions' qg_fixed_json.json) - + echo "${conditions}" echo "projstatus=${projstatus}" >> $GITHUB_OUTPUT echo "caycStatus=${caycStatus}" >> $GITHUB_OUTPUT echo "conditions=${conditions}" >> $GITHUB_OUTPUT From 775aae24b171430491eb985c4c6d8ce7b84b967a Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 07:09:05 -0500 Subject: [PATCH 06/18] .... --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index 985ea015..2f419637 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -103,7 +103,7 @@ jobs: id: convert-json-to-md uses: parkerbxyz/json-to-markdown-table@v1.1.2 with: - json: ${{ steps.json-cleanup.outputs.projstatus }} + json: ${{ steps.json-cleanup.outputs.conditions }} - name: Verify markdown output run: | From 299d22712c164bbb89961388c0e69eb350acd12e Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 08:19:26 -0500 Subject: [PATCH 07/18] Switching to a different JSON-to-MD action. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index 2f419637..ccaa1120 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -101,7 +101,7 @@ jobs: - name: Convert JSON to Markdown Table id: convert-json-to-md - uses: parkerbxyz/json-to-markdown-table@v1.1.2 + uses: uses: buildingcash/json-to-markdown-table-action@v1.1.0 with: json: ${{ steps.json-cleanup.outputs.conditions }} From f7a0a1f89d1c21e454dc9a636a7ff529c0b05a79 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 08:23:13 -0500 Subject: [PATCH 08/18] Typo fix. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index ccaa1120..4df9f4d6 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -101,7 +101,7 @@ jobs: - name: Convert JSON to Markdown Table id: convert-json-to-md - uses: uses: buildingcash/json-to-markdown-table-action@v1.1.0 + uses: buildingcash/json-to-markdown-table-action@v1.1.0 with: json: ${{ steps.json-cleanup.outputs.conditions }} From 18133a812bdfc623210bc4f75f787ded4a3f1dcd Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 08:29:22 -0500 Subject: [PATCH 09/18] Removing multi-line indication. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index 4df9f4d6..1854141a 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -106,8 +106,7 @@ jobs: json: ${{ steps.json-cleanup.outputs.conditions }} - name: Verify markdown output - run: | - echo ${{ steps.convert-json-to-md.outputs.table }} + run: echo ${{ steps.convert-json-to-md.outputs.table }} # Step 2: Post SonarQube results as comment (using curl commands and Gitea API) # - name: Post SonarQube Results as Comment From fbf998896fd2b009b2442840ee803b7952cdd25f Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 08:40:11 -0500 Subject: [PATCH 10/18] Removing multi-line indication. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index 1854141a..2bce77a9 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -106,7 +106,7 @@ jobs: json: ${{ steps.json-cleanup.outputs.conditions }} - name: Verify markdown output - run: echo ${{ steps.convert-json-to-md.outputs.table }} + run: echo "${{ steps.convert-json-to-md.outputs.table }}" # Step 2: Post SonarQube results as comment (using curl commands and Gitea API) # - name: Post SonarQube Results as Comment From ebd1194f3415c2945bee56c2506a063cf4d6a7ed Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 09:27:10 -0500 Subject: [PATCH 11/18] Testing out PR comment. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index 2bce77a9..c51ab303 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -105,9 +105,6 @@ jobs: with: json: ${{ steps.json-cleanup.outputs.conditions }} - - name: Verify markdown output - run: echo "${{ steps.convert-json-to-md.outputs.table }}" - # Step 2: Post SonarQube results as comment (using curl commands and Gitea API) # - name: Post SonarQube Results as Comment # run: | @@ -120,6 +117,16 @@ jobs: # "body": "SonarQube analysis results:\n\n- Bugs: ${{ env.SONAR_BUGS }}\n- Vulnerabilities: ${{ env.SONAR_VULNERABILITIES }}\n- Code Smells: ${{ env.SONAR_CODE_SMELLS }}\n- Coverage: ${{ env.SONAR_COVERAGE }}%\n- Duplications: ${{ env.SONAR_DUPLICATIONS }}%\n- Quality Gate Status: ${{ env.SONAR_QUALITY_GATE_STATUS }}" # }' + - name: Post SonarQube Results as Comment + run: | + curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/${{ github.pull_request.number }}/reviews \ + -X POST \ + -H 'Accept: application/json' \ + -H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \ + -H 'Content-Type: application/json' \ + -d '{ + "body": "SonarQube analysis results:\n\n${{ steps.convert-json-to-md.outputs.table }}\n\n${{ steps.quality-gate.outputs.quality-gate-status }}" + }' # # Job 3: Merge PR if Quality Gate passes # merge-pr: # runs-on: ubuntu-latest From 20a781c17867d24ad9967d2537377cb12c4e5dcf Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 09:37:13 -0500 Subject: [PATCH 12/18] Verifying PR index for curl request. --- .../workflows/branch-sonarscan-pr-merge.yml | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index c51ab303..481f6d1a 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -116,17 +116,20 @@ jobs: # -d '{ # "body": "SonarQube analysis results:\n\n- Bugs: ${{ env.SONAR_BUGS }}\n- Vulnerabilities: ${{ env.SONAR_VULNERABILITIES }}\n- Code Smells: ${{ env.SONAR_CODE_SMELLS }}\n- Coverage: ${{ env.SONAR_COVERAGE }}%\n- Duplications: ${{ env.SONAR_DUPLICATIONS }}%\n- Quality Gate Status: ${{ env.SONAR_QUALITY_GATE_STATUS }}" # }' - - - name: Post SonarQube Results as Comment + - name: Verify PR number run: | - curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/${{ github.pull_request.number }}/reviews \ - -X POST \ - -H 'Accept: application/json' \ - -H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \ - -H 'Content-Type: application/json' \ - -d '{ - "body": "SonarQube analysis results:\n\n${{ steps.convert-json-to-md.outputs.table }}\n\n${{ steps.quality-gate.outputs.quality-gate-status }}" - }' + echo "PR number: ${{ github.event.pull_request.number }}" + + # - name: Post SonarQube Results as Comment + # run: | + # curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/${{ github.pull_request.number }}/reviews \ + # -X POST \ + # -H 'Accept: application/json' \ + # -H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \ + # -H 'Content-Type: application/json' \ + # -d '{ + # "body": "SonarQube analysis results:\n\n${{ steps.convert-json-to-md.outputs.table }}\n\n${{ steps.quality-gate.outputs.quality-gate-status }}" + # }' # # Job 3: Merge PR if Quality Gate passes # merge-pr: # runs-on: ubuntu-latest From 6369095c9e7b0c46a5c85c4e12e49026824ea3ea Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 09:45:37 -0500 Subject: [PATCH 13/18] Verifying PR index for curl request #2. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index 481f6d1a..f5d74d0f 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -118,7 +118,7 @@ jobs: # }' - name: Verify PR number run: | - echo "PR number: ${{ github.event.pull_request.number }}" + echo "PR number: "${{ gitea.pull_request.id }}" # - name: Post SonarQube Results as Comment # run: | From f4893e21ff5bf0bbf0784b279d6ecd712220792d Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 10:18:15 -0500 Subject: [PATCH 14/18] Corrected missing quote. --- .../workflows/branch-sonarscan-pr-merge.yml | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index f5d74d0f..b6517b5b 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -59,7 +59,19 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - # Step 1: Run SonarQube Scan + # - name: Start Gitea-Sonarqube Bot + # uses: docker://justusbunsi/gitea-sonarqube-bot:v0.3.3 + # with: + # # Required inputs for the bot + # args: > + # --sonarqube-url ${{ secrets.SONARQUBE_URL }} + # --sonarqube-token ${{ secrets.SONARQUBE_TOKEN }} + # --git-provider github + # --git-api-url https://api.github.com + # --git-token ${{ secrets.GITHUB_TOKEN }} + # --repository my-org/my-repo + # --pull-request-id ${{ github.event.pull_request.number }} + - name: SonarQube Scan uses: sonarsource/sonarqube-scan-action@v4.1.0 env: @@ -105,20 +117,19 @@ jobs: with: json: ${{ steps.json-cleanup.outputs.conditions }} - # Step 2: Post SonarQube results as comment (using curl commands and Gitea API) - # - name: Post SonarQube Results as Comment - # run: | - # curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/${{ github.pull_request.number }}/reviews \ - # -X POST \ - # -H 'Accept: application/json' \ - # -H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \ - # -H 'Content-Type: application/json' \ - # -d '{ - # "body": "SonarQube analysis results:\n\n- Bugs: ${{ env.SONAR_BUGS }}\n- Vulnerabilities: ${{ env.SONAR_VULNERABILITIES }}\n- Code Smells: ${{ env.SONAR_CODE_SMELLS }}\n- Coverage: ${{ env.SONAR_COVERAGE }}%\n- Duplications: ${{ env.SONAR_DUPLICATIONS }}%\n- Quality Gate Status: ${{ env.SONAR_QUALITY_GATE_STATUS }}" - # }' + - name: Post SonarQube Results as Comment + run: | + curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/${{ github.pull_request.number }}/reviews \ + -X POST \ + -H 'Accept: application/json' \ + -H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \ + -H 'Content-Type: application/json' \ + -d '{ + "body": "SonarQube analysis results:\n\n- Bugs: ${{ env.SONAR_BUGS }}\n- Vulnerabilities: ${{ env.SONAR_VULNERABILITIES }}\n- Code Smells: ${{ env.SONAR_CODE_SMELLS }}\n- Coverage: ${{ env.SONAR_COVERAGE }}%\n- Duplications: ${{ env.SONAR_DUPLICATIONS }}%\n- Quality Gate Status: ${{ env.SONAR_QUALITY_GATE_STATUS }}" + }' - name: Verify PR number run: | - echo "PR number: "${{ gitea.pull_request.id }}" + echo "PR number: ${{ gitea.pull_request.id }}" # - name: Post SonarQube Results as Comment # run: | From f77134374e16c2235ba722cc6c708d88afc8a495 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 10:34:41 -0500 Subject: [PATCH 15/18] Tweaking PR ref. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index b6517b5b..efc36caf 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -129,7 +129,7 @@ jobs: }' - name: Verify PR number run: | - echo "PR number: ${{ gitea.pull_request.id }}" + echo "PR number: ${{ gitea.event.number }}" # - name: Post SonarQube Results as Comment # run: | From 31b942ff567d64e2fb1c79a9b784dbf87d4b1bae Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 10:41:26 -0500 Subject: [PATCH 16/18] Tweaking PR ref. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index efc36caf..ad96e66b 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -129,7 +129,7 @@ jobs: }' - name: Verify PR number run: | - echo "PR number: ${{ gitea.event.number }}" + echo "PR number: ${{ github.event.number }}" # - name: Post SonarQube Results as Comment # run: | From 6b1a84fa219abef8568f7f97612cd8e0b8a660db Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 10:48:34 -0500 Subject: [PATCH 17/18] Tweaking PR ref. --- .../workflows/branch-sonarscan-pr-merge.yml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index ad96e66b..264b98b2 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -117,19 +117,19 @@ jobs: with: json: ${{ steps.json-cleanup.outputs.conditions }} - - name: Post SonarQube Results as Comment - run: | - curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/${{ github.pull_request.number }}/reviews \ - -X POST \ - -H 'Accept: application/json' \ - -H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \ - -H 'Content-Type: application/json' \ - -d '{ - "body": "SonarQube analysis results:\n\n- Bugs: ${{ env.SONAR_BUGS }}\n- Vulnerabilities: ${{ env.SONAR_VULNERABILITIES }}\n- Code Smells: ${{ env.SONAR_CODE_SMELLS }}\n- Coverage: ${{ env.SONAR_COVERAGE }}%\n- Duplications: ${{ env.SONAR_DUPLICATIONS }}%\n- Quality Gate Status: ${{ env.SONAR_QUALITY_GATE_STATUS }}" + # - name: Post SonarQube Results as Comment + # run: | + # curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/${{ github.pull_request.number }}/reviews \ + # -X POST \ + # -H 'Accept: application/json' \ + # -H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \ + # -H 'Content-Type: application/json' \ + # -d '{ + # "body": "SonarQube analysis results:\n\n- Bugs: ${{ env.SONAR_BUGS }}\n- Vulnerabilities: ${{ env.SONAR_VULNERABILITIES }}\n- Code Smells: ${{ env.SONAR_CODE_SMELLS }}\n- Coverage: ${{ env.SONAR_COVERAGE }}%\n- Duplications: ${{ env.SONAR_DUPLICATIONS }}%\n- Quality Gate Status: ${{ env.SONAR_QUALITY_GATE_STATUS }}" }' - name: Verify PR number run: | - echo "PR number: ${{ github.event.number }}" + echo "PR number: ${{ gitea.event.pull_request.number }}" # - name: Post SonarQube Results as Comment # run: | From 1b8c035ba123bd8b69d9b62e2a1b9ab878a8a70e Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 10:49:11 -0500 Subject: [PATCH 18/18] Typo fix. --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index 264b98b2..b4667762 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -126,7 +126,7 @@ jobs: # -H 'Content-Type: application/json' \ # -d '{ # "body": "SonarQube analysis results:\n\n- Bugs: ${{ env.SONAR_BUGS }}\n- Vulnerabilities: ${{ env.SONAR_VULNERABILITIES }}\n- Code Smells: ${{ env.SONAR_CODE_SMELLS }}\n- Coverage: ${{ env.SONAR_COVERAGE }}%\n- Duplications: ${{ env.SONAR_DUPLICATIONS }}%\n- Quality Gate Status: ${{ env.SONAR_QUALITY_GATE_STATUS }}" - }' + # }' - name: Verify PR number run: | echo "PR number: ${{ gitea.event.pull_request.number }}"