From f4893e21ff5bf0bbf0784b279d6ecd712220792d Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Thu, 19 Dec 2024 10:18:15 -0500 Subject: [PATCH] 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: |