{"id":15682328,"url":"https://github.com/tspascoal/fail-workflow-on-alerts-action","last_synced_at":"2026-01-30T11:15:17.788Z","repository":{"id":42652144,"uuid":"366354098","full_name":"tspascoal/fail-workflow-on-alerts-action","owner":"tspascoal","description":"GitHub Action to fail a workflow if code scanning alerts exceed certain thresholds","archived":false,"fork":false,"pushed_at":"2024-06-18T16:56:44.000Z","size":443,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-01T22:01:47.902Z","etag":null,"topics":["actions"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tspascoal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-11T11:13:59.000Z","updated_at":"2024-06-18T16:56:47.000Z","dependencies_parsed_at":"2024-06-18T21:07:06.907Z","dependency_job_id":"8b43208b-fd0d-460a-8c0c-6cc36976308a","html_url":"https://github.com/tspascoal/fail-workflow-on-alerts-action","commit_stats":{"total_commits":23,"total_committers":3,"mean_commits":7.666666666666667,"dds":0.4347826086956522,"last_synced_commit":"c57dbc331600bb9bd18672f737a1d88605daf2a8"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tspascoal%2Ffail-workflow-on-alerts-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tspascoal%2Ffail-workflow-on-alerts-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tspascoal%2Ffail-workflow-on-alerts-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tspascoal%2Ffail-workflow-on-alerts-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tspascoal","download_url":"https://codeload.github.com/tspascoal/fail-workflow-on-alerts-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239418748,"owners_count":19635243,"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":["actions"],"created_at":"2024-10-03T17:00:50.859Z","updated_at":"2025-11-03T20:30:35.650Z","avatar_url":"https://github.com/tspascoal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fail workflow on alerts action\n\n![build-test](https://github.com/tspascoal/fail-workflow-on-alerts-action/actions/workflows/test.yml/badge.svg)\n\nIt is recommended that you [advanced-security-compliance](https://github.com/advanced-security/policy-as-code) instead, it is more feature rich than Fail workflow on alerts action\n\n\u003e [!WARNING]\n\u003e EXPERIMENTAL. Haven't completely tested all the semantics. Use at your own peril.\n\nThis action will fail a workflow if there are open [Code Scanning](https://docs.github.com/en/code-security/secure-coding/about-code-scanning) alerts that exceed the defined thresholds. (eg: there are more than X critical alerts).\n\nIt scans for open alerts in the current git reference. Be it a PR or a non PR\n\nFailure is optional, the action also outputs the number of alerts (by type) found, the workflow will fail if the number `TYPE` alerts found is greater than `MAX_ALERT_TYPE`.\n\n\u003e ~~Known Issue: If action runs immediately after the SARIF file upload (either an action) the results may be delayed. Haven't fully determined the cause but it seems the processing of the SARIF file is asychronous. Try to run the action as later as possible.~~ This no longer happens unless you have set the parameter `wait-for-processing` to false. \n\nAlternatively you can also configure the severity of [alerts that will issue a failed check](https://docs.github.com/en/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#defining-the-alert-severities-causing-pull-request-check-failure) and then combine this with branch protection rules to prevent pull requests from being completed.\n\n## Usage\n\n```YAML\n- uses: tspascoal/fail-workflow-on-alerts-action@v0\n  id: alerts\n  with:\n    max_errors: 10 # optional. Skip or -1 to ignore alerts\n    max_warnings: 100 # optional. Skip or -1 to ignore alerts\n    max_notes: 1000 # optional. Skip or -1 to ignore alerts\n    max_unknowns: 5 # optional. Skip or -1 to ignore alerts\n    max_none: 3 # optional. Skip or -1 to ignore alerts\n\n- run: |\n    echo number errors ${{ steps.alerts.outputs.error }}\n    echo number warnings ${{ steps.alerts.outputs.warning }}\n    echo number notes ${{ steps.alerts.outputs.note }}\n```\n\n## Alternatives\n\nAn alternate method, is to look directly at the Sarif file generated by codeql (or any other scanning tool) and fail workflow if there are issues. This method has the disadvantage of not ignoring alerts that you have dismissed in the UI as not important.\n\nThis method is described [here](https://josh-ops.com/posts/github-codeql-pr/).\n\n## Related actions\n\nIn case you want to generate a nice PDF report with security finds you can use the [GitHub Security Report Action](https://github.com/marketplace/actions/github-security-report-action) action.\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftspascoal%2Ffail-workflow-on-alerts-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftspascoal%2Ffail-workflow-on-alerts-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftspascoal%2Ffail-workflow-on-alerts-action/lists"}