SonarQube Trigger icon

SonarQube Trigger

Triggers workflow when SonarQube/SonarCloud events occur

Overview

This node triggers workflows based on events from SonarQube or SonarCloud, specifically when a project analysis is completed or when the quality gate status changes. It is useful for automating responses to code quality changes, such as notifying teams or updating dashboards when analysis results or quality gate statuses are updated.

Use Case Examples

  1. Trigger a workflow when a project analysis completes to send a notification email.
  2. Trigger a workflow when the quality gate status changes to update a project management tool.

Properties

Name Meaning
Event The specific SonarQube event to listen for, either 'Analysis Completed' or 'Quality Gate Changed'.
Filters Filters to narrow down which events trigger the workflow, including project keys, quality gate status, and task status.
Options Additional options for the trigger, including a webhook secret for validating incoming webhook requests.

Output

JSON

  • project
    • key - The key of the project related to the event.
  • status - The status of the analysis task or quality gate.
  • qualityGate
    • status - The status of the quality gate if applicable.
  • event - The type of event that triggered the workflow, e.g., analysisCompleted or qualityGateChanged.

Dependencies

  • An API key credential for SonarQube API access is required.

Troubleshooting

  • If the webhook secret is set but the incoming request does not have a matching HMAC-SHA256 signature, the workflow will not trigger. Ensure the secret matches the one configured in SonarQube webhook settings.
  • If filters are set for project keys, quality gate status, or task status, events not matching these filters will not trigger the workflow. Verify filter values are correct and match the incoming event data.
  • Common error might be missing or incorrect API credentials, which will prevent the node from authenticating with SonarQube.

Links

Discussion