Skip to content

fix(ci): skip SonarQube scan for dependabot-triggered PRs - #203

Open
syed-awsaf-informed wants to merge 2 commits into
developfrom
bugfix/sonar-skip-dependabot
Open

fix(ci): skip SonarQube scan for dependabot-triggered PRs#203
syed-awsaf-informed wants to merge 2 commits into
developfrom
bugfix/sonar-skip-dependabot

Conversation

@syed-awsaf-informed

@syed-awsaf-informed syed-awsaf-informed commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Dependabot PRs don't get access to repo secrets, so the SonarQube scan step was failing every time trying to use SONAR_TOKEN_N3. This skips the scan step for Dependabot PRs.

Copilot AI lite review requested due to automatic review settings August 11, 2026 17:13
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

✅ OSS Checks Passed

All tracked OSS checks passed in this run.

📊 Total Files 🟢 Passed 🔴 Failed 🧮 Score
14 14 0 100%

Results from commit 4d7467e, view the full job summary↗️ for detailed results.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Maven GitHub Actions workflow to avoid failing Dependabot-authored PR runs by separating the JaCoCo-producing mvn verify step from the SonarQube scan and skipping the scan when the actor is dependabot[bot].

Changes:

  • Split SonarQube scanning out of the “Code Coverage” step into a dedicated “SonarQube Scan” step.
  • Add a conditional guard to skip the SonarQube scan on Dependabot-triggered PRs while still running mvn verify to produce the JaCoCo report.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/maven.yml Outdated
Comment on lines +57 to +60
- name: Code Coverage
env:
GH_PACKAGES_PAT: ${{ secrets.GH_PACKAGES_PAT }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_N3 }}
run: ./mvnw $MAVEN_CLI_OPTS verify -Dsonar.projectKey=National-Node-Net_federator -Dsonar.organization=national-node-net -Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
run: ./mvnw $MAVEN_CLI_OPTS verify
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants