Help Center/ CodeArts Agent/ Best Practices/ Developing a Crawler Program with CodeArts Agent and a Third-Party R&D Toolchain/ Setting Up a Remote Project Repository, Managing Branches, and Deploying the Local Environment/ Creating an Automatic Code Check Task on SonarQube
Updated on 2026-08-04 GMT+08:00
Creating an Automatic Code Check Task on SonarQube
Configuring Automatic Code Check
- Use your GitHub account to log in to the SonarQube homepage.
- Click Favorite projects on the navigation bar and click Configure analysis. Figure 1 Configuring code check
- Click With GitHub Actions to go to the page for configuring the interconnection between SonarQube and GitHub Actions.

- Click Settings > Secrets and variables > Actions and select Python (Python is used for coding in this practice) to open the page for creating a secret for the target code repository. Figure 2 Parameters for interconnecting with GitHub Actions
- Click New repository secret to open the page for entering secret information. Figure 3 Configuring a secret
- Copy the values of Name and Value in 4 and paste them to the Name and Secret text boxes on the page for adding a secret. Click Add secret. Figure 4 Entering secret parameters
- After the secret is successfully configured on GitHub, return to the SonarQube page that was opened in 4. Click Python, Windows, and then Copy to copy the secret, and save it to the local PC.

- Log in to GitHub. On the homepage of the url-link-extractor repository, click
to go to the branch page of the repository. Click New branch in the upper right corner, enter the name of the new code branch in the New branch name text box, and click Create new branch. In this practice, enter the branch name develop. - Click develop to go to the code home page of the develop branch. Figure 5 Opening the home page of the develop branch
- Click Add file and then Create new file to go to the page for creating a file. Figure 6 Opening the page for creating a file
- Copy the .github/workflows/ci.yml path and paste it to the file name text box. The ci.yml file is automatically created in the .github/workflows/ directory. Figure 7 Creating the ci.yml file
- Paste the content copied and saved in 4 to the ci.yml file. When you commit code from the local PC to the develop branch, the code repository url-link-extractor automatically triggers the pipeline.
name: Build on: push: branches: - main - develop pull_request: types: [opened, synchronize, reopened] jobs: sonarqube: name: SonarQube runs-on: windows-latest steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: SonarQube Scan uses: SonarSource/sonarqube-scan-action@7006c4492b2e0ee0f816d36501671557c97f5995 # v8.1.0 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}Note that code in this practice is developed based on the develop branch. It is expected that the code is also scanned when the develop branch is pushed. Therefore, the - develop value is added under branches.
- After pasting the content, click Commit changes in the upper right corner.
- Click Add file and then Create new file to go to the page for creating a file. Figure 8 Opening the page for creating a file
- Switch to the develop branch. In the root directory, paste the content of point 3 in 4 to the new file name and content, click Commit changes twice. The Code page is automatically displayed. Figure 9 Point 3 of Project onboarding
Figure 10 Creating a sonar-project.properties file
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot