Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 12, 2025

Description

Skip SonarCloud analysis when PRs are created by Dependabot. Automated dependency updates don't require code quality analysis and consume unnecessary CI resources.

Resolves #296

Changes

Modified .github/workflows/maven_pull_request.yml:

  • Added ACTOR environment variable to capture github.actor
  • Extended conditional to skip SonarCloud when ACTOR == "dependabot[bot]"
  • Maintains existing behavior of skipping analysis for forked PRs
- name: Scan with Sonar
  run: |
    if [ $FORK = false ] && [ "$ACTOR" != "dependabot[bot]" ]
    then
      mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar ...
    fi
  env:
    FORK: ${{ github.event.pull_request.head.repo.fork }}
    ACTOR: ${{ github.actor }}

Checklist:

  • Public methods are documented
  • Public methods are tested
  • New and existing tests pass when run locally
  • There are no new warnings or errors
Original prompt

This section details on the original issue you should resolve

<issue_title>[Enhancement]: Skip Sonar Cloud analysis for Dependabot PRs</issue_title>
<issue_description>### What

Skip Sonar Cloud analysis when the pull request is created by dependabot. The CI should detect PRs from dependabot and avoid running SonarCloud analysis for them.

Why

Dependabot pull requests are automated dependency updates and may generate unnecessary Sonar Cloud analysis runs, consuming resources without much value. Skipping these can save CI time and keep Sonar metrics clean.

Notes

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Copilot AI changed the title [WIP] Skip Sonar Cloud analysis for Dependabot pull requests Skip SonarCloud analysis for Dependabot PRs Nov 12, 2025
Copilot AI requested a review from thomasturrell November 12, 2025 16:57
@thomasturrell thomasturrell marked this pull request as ready for review November 12, 2025 16:58
@sonarqubecloud
Copy link

@thomasturrell thomasturrell merged commit 44a0757 into main Nov 12, 2025
6 checks passed
@thomasturrell thomasturrell deleted the copilot/skip-sonarcloud-analysis-dependabot branch November 12, 2025 17:13
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.

[Enhancement]: Skip Sonar Cloud analysis for Dependabot PRs

2 participants