Merge pull request 'update sonar' (#373) from KingChan/forgeplus:standalone_develop into standalone_develop

This commit is contained in:
KingChan 2025-06-07 11:13:41 +08:00
commit 6d51061f49
2 changed files with 26 additions and 28 deletions

View File

@ -46,33 +46,31 @@ class Api::V1::SonarqubesController < Api::V1::BaseController
filepath: '.gitea/workflows/SonarScanner.yaml',
branch: params[:branch],
new_branch: nil,
content: "
name: Sonar Scanner
jobs:
sonarqube:
runs-on: ubuntu-latest
steps:
- uses: #{checkout_url}
with:
# Disabling shallow clones is recommended for improving the relevancy of reporting
fetch-depth: 1
single-branch: true
- name: curl doxygen
run: |
curl -X GET #{doxygen_url}/generate?repo=#{@project.repository.url}
- name: new properties
run: |
cat <<EOF > sonar-project.properties
#{sonar_content}
EOF
- name: SonarQube Scan
uses: #{scanner_url}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
",
content: <<-YAML
name: Sonar Scanner
jobs:
sonarqube:
runs-on: ubuntu-latest
steps:
- uses: #{checkout_url}
with:
fetch-depth: 1
single-branch: true
- name: curl doxygen
run: |
curl -X GET #{doxygen_url}/generate?repo=#{@project.repository.url}
- name: new properties
run: |
cat <<EOF > sonar-project.properties
#{sonar_content}
EOF
- name: SonarQube Scan
uses: #{scanner_url}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
YAML
,
message: 'Add .gitea/workflows/SonarScanner.yaml',
committer: {
email: @owner.mail,

View File

@ -39,6 +39,6 @@ module SonarService
lines << "sonar.cxx.errorRecoveryEnabled=true"
end
lines.join("\n")
lines
end
end