{"id":28495968,"url":"https://github.com/sonarsource/sonarqube-quality-gate-action","last_synced_at":"2025-07-02T10:31:27.130Z","repository":{"id":41569814,"uuid":"366408880","full_name":"SonarSource/sonarqube-quality-gate-action","owner":"SonarSource","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-05T10:10:28.000Z","size":87,"stargazers_count":73,"open_issues_count":0,"forks_count":78,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-06-08T11:51:22.368Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SonarSource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-05-11T14:23:36.000Z","updated_at":"2025-06-02T13:41:55.000Z","dependencies_parsed_at":"2024-11-15T11:25:03.556Z","dependency_job_id":"f0a1e97f-d153-4b64-bcb2-f35c3de4f807","html_url":"https://github.com/SonarSource/sonarqube-quality-gate-action","commit_stats":{"total_commits":16,"total_committers":8,"mean_commits":2.0,"dds":0.625,"last_synced_commit":"d304d050d930b02a896b0f85935344f023928496"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/SonarSource/sonarqube-quality-gate-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonarSource%2Fsonarqube-quality-gate-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonarSource%2Fsonarqube-quality-gate-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonarSource%2Fsonarqube-quality-gate-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonarSource%2Fsonarqube-quality-gate-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SonarSource","download_url":"https://codeload.github.com/SonarSource/sonarqube-quality-gate-action/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonarSource%2Fsonarqube-quality-gate-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263120639,"owners_count":23416859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-08T11:38:20.355Z","updated_at":"2025-07-02T10:31:27.118Z","avatar_url":"https://github.com/SonarSource.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SonarQube Quality Gate check [![QA](https://github.com/SonarSource/sonarqube-quality-gate-action/actions/workflows/run-qa.yml/badge.svg)](https://github.com/SonarSource/sonarqube-quality-gate-action/actions/workflows/run-qa.yml)\n\nCheck the Quality Gate of your code with [SonarQube Server](https://www.sonarsource.com/products/sonarqube/) or [SonarQube Community Build](https://www.sonarsource.com/open-source-editions/sonarqube-community-edition/) to ensure your code meets your own quality standards before you release or deploy new features.\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./images/SonarQube_dark.png\"\u003e\n  \u003cimg alt=\"Logo\" src=\"./images/SonarQube_light.png\"\u003e\n\u003c/picture\u003e\n\n[SonarQube Server](https://www.sonarsource.com/products/sonarqube/) and [SonarQube Community Build](https://www.sonarsource.com/open-source-editions/sonarqube-community-edition/) are widely used static analysis solutions for continuous code quality and security inspection.\n\nThey help developers detect coding issues in 30+ languages, frameworks, and IaC platforms, including Java, JavaScript, TypeScript, C#, Python, C, C++, and [many more](https://www.sonarsource.com/knowledge/languages/).\n\n## Requirements\n\nA previous step must have run an analysis on your code.\n\nRead more information on how to analyze your code for SonarQube Server [here](https://docs.sonarsource.com/sonarqube-server/latest/devops-platform-integration/github-integration/introduction/) and for SonarQube Community Build [here](https://docs.sonarsource.com/sonarqube-community-build/devops-platform-integration/github-integration/introduction/)\n\n## Usage\n\nThe workflow YAML file will usually look something like this::\n\n```yaml\non:\n  # Trigger analysis when pushing in master or pull requests, and when creating\n  # a pull request.\n  push:\n    branches:\n      - master\n  pull_request:\n    types: [opened, synchronize, reopened]\nname: Main Workflow\njobs:\n  sonarqube:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          # Disabling shallow clone is recommended for improving relevancy of reporting.\n          fetch-depth: 0\n\n      # Triggering SonarQube analysis as results of it are required by Quality Gate check.\n      - name: SonarQube Scan\n        uses: sonarsource/sonarqube-scan-action@master\n        env:\n          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n          SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}\n\n      # Check the Quality Gate status.\n      - name: SonarQube Quality Gate check\n        id: sonarqube-quality-gate-check\n        uses: sonarsource/sonarqube-quality-gate-action@master\n        with:\n          pollingTimeoutSec: 600\n        env:\n          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}\n          SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} #OPTIONAL\n\n      # Optionally you can use the output from the Quality Gate in another step.\n      # The possible outputs of the `quality-gate-status` variable are `PASSED`, `WARN` or `FAILED`.\n      - name: \"Example show SonarQube Quality Gate Status value\"\n        run: echo \"The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}\"\n```\n\nMake sure to set up `pollingTimeoutSec` property in your step, to avoid wasting action minutes per month (see above example). If not provided, the default value of 300s is applied.\n\nWhen using this action with [sonarsource/sonarqube-scan](https://github.com/SonarSource/sonarqube-scan-action) action or with [C/C++ code analysis](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/languages/c-family/overview/) (available only for SonarQube Server) you don't have to provide `scanMetadataReportFile` input, otherwise you should alter the location of it.\n\nTypically, report metadata file for different scanners can vary and can be located in:\n\n- `target/sonar/report-task.txt` for Maven projects\n- `build/sonar/report-task.txt` for Gradle projects\n- `.sonarqube/out/.sonar/report-task.txt` for .NET projects\n\nExample usage:\n\n```yaml\n- name: SonarQube Quality Gate check\n  uses: sonarsource/sonarqube-quality-gate-action@master\n  with:\n    scanMetadataReportFile: target/sonar/report-task.txt\n```\n\n### Environment variables\n\n- `SONAR_TOKEN` – **Required** this is the token used to authenticate access to SonarQube. You can read more about security tokens [here](https://docs.sonarqube.org/latest/user-guide/user-token/). You can set the `SONAR_TOKEN` environment variable in the \"Secrets\" settings page of your repository, or you can add them at the level of your GitHub organization (recommended).\n\n- `SONAR_HOST_URL` – **Optional** this tells the scanner where SonarQube is hosted, otherwise it will get the one from the scan report. You can set the `SONAR_HOST_URL` environment variable in the \"Secrets\" settings page of your repository, or you can add them at the level of your GitHub organization (recommended).\n\n- `SONAR_ROOT_CERT` – Holds an additional root certificate (in PEM format) that is used to validate the SonarQube certificate. You can set the `SONAR_ROOT_CERT` environment variable in the \"Secrets\" settings page of your repository, or you can add them at the level of your GitHub organization (recommended).\n\n## Quality Gate check run\n\n\u003cimg src=\"./images/QualityGate-check-screen.png\"\u003e\n\n## Have questions or feedback?\n\nTo provide feedback (requesting a feature or reporting a bug) please post on the [SonarSource Community Forum](https://community.sonarsource.com/tags/c/help/sq/github-actions).\n\n## License\n\nScripts and documentation in this project are released under the LGPLv3 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonarsource%2Fsonarqube-quality-gate-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonarsource%2Fsonarqube-quality-gate-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonarsource%2Fsonarqube-quality-gate-action/lists"}