prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  bug: No way to dismiss image scan alerts
  ### Meltano Version
  
  NA
  
  ### Python Version
  
  NA
  
  ### Bug scope
  
  Other
  
  ### Operating System
  
  NA
  
  ### Description
  
  Currently we use `.github/actions/docker-build-scan-push/check_sarif.py` to analyze the SARIF report created from running `grype` to scan our Docker images. It parses the SARIF JSON file itself to check if there are any issues detected with a severity above some threshold in the range [0.0, 10.0].
  
  Before running this check, we upload the SARIF results to GitHub, which stores them for our repository using the "code scanning" feature. From there, we can review them, dismiss them, and create issues to address them. [An example can be found here](https://github.com/meltano/meltano/security/code-scanning?query=ref%3Arefs%2Fpull%2F6410%2Fmerge+tool%3AGrype).
  
  Our `check_sarif.py` script does not consider whether we've dismissed the issue via GitHub's "code scanning" feature, so we have no way to deem a detected issue acceptable, and have the Docker publish workflow pass. To fix this we should replace `check_sarif.py` with some steps that use [the GitHub code scanning API](https://docs.github.com/en/rest/code-scanning#list-code-scanning-alerts-for-a-repository) to check if there are any issues above some set severity level *that haven't been dismissed*.
  
  ### Code
  
  _No response_
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `.github/actions/docker-build-scan-push/check_sarif.py`
  Content:
  ```
  1 """Check if the provided SARIF file has any violations at or above some severity level."""
  2 
  3 from __future__ import annotations
  4 
  5 import argparse
  6 import json
  7 
  8 DEFAULT_SEVERITY_CUTOFF = 4.0
  9 
  10 parser = argparse.ArgumentParser()
  11 parser.add_argument(
  12     "sarif_path",
  13     help="The path to the SARIF file to be checked.",
  14 )
  15 parser.add_argument(
  16     "--severity-cutoff",
  17     help="Violations with a severity >= this value result in an exit code of 1"
  18     + " - must be a number in the range [0.0, 10.0].",
  19     type=float,
  20     default=DEFAULT_SEVERITY_CUTOFF,
  21 )
  22 args = parser.parse_args()
  23 
  24 with open(args.sarif_path) as sarif_file:
  25     sarif_data = json.load(sarif_file)
  26 
  27 first_run = sarif_data["runs"][0]
  28 triggered_rules = first_run["tool"]["driver"]["rules"]
  29 
  30 exit(  # noqa: WPS421
  31     any(
  32         float(rule["properties"]["security-severity"]) >= args.severity_cutoff
  33         for rule in triggered_rules
  34     )
  35 )
  36
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/.github/actions/docker-build-scan-push/check_sarif.py b/.github/actions/docker-build-scan-push/check_sarif.py
  deleted file mode 100644
  --- a/.github/actions/docker-build-scan-push/check_sarif.py
  +++ /dev/null
  @@ -1,35 +0,0 @@
  -"""Check if the provided SARIF file has any violations at or above some severity level."""
  -
  -from __future__ import annotations
  -
  -import argparse
  -import json
  -
  -DEFAULT_SEVERITY_CUTOFF = 4.0
  -
  -parser = argparse.ArgumentParser()
  -parser.add_argument(
  -    "sarif_path",
  -    help="The path to the SARIF file to be checked.",
  -)
  -parser.add_argument(
  -    "--severity-cutoff",
  -    help="Violations with a severity >= this value result in an exit code of 1"
  -    + " - must be a number in the range [0.0, 10.0].",
  -    type=float,
  -    default=DEFAULT_SEVERITY_CUTOFF,
  -)
  -args = parser.parse_args()
  -
  -with open(args.sarif_path) as sarif_file:
  -    sarif_data = json.load(sarif_file)
  -
  -first_run = sarif_data["runs"][0]
  -triggered_rules = first_run["tool"]["driver"]["rules"]
  -
  -exit(  # noqa: WPS421
  -    any(
  -        float(rule["properties"]["security-severity"]) >= args.severity_cutoff
  -        for rule in triggered_rules
  -    )
  -)
  
verification_info: {"golden_diff": "diff --git a/.github/actions/docker-build-scan-push/check_sarif.py b/.github/actions/docker-build-scan-push/check_sarif.py\ndeleted file mode 100644\n--- a/.github/actions/docker-build-scan-push/check_sarif.py\n+++ /dev/null\n@@ -1,35 +0,0 @@\n-\"\"\"Check if the provided SARIF file has any violations at or above some severity level.\"\"\"\n-\n-from __future__ import annotations\n-\n-import argparse\n-import json\n-\n-DEFAULT_SEVERITY_CUTOFF = 4.0\n-\n-parser = argparse.ArgumentParser()\n-parser.add_argument(\n-    \"sarif_path\",\n-    help=\"The path to the SARIF file to be checked.\",\n-)\n-parser.add_argument(\n-    \"--severity-cutoff\",\n-    help=\"Violations with a severity >= this value result in an exit code of 1\"\n-    + \" - must be a number in the range [0.0, 10.0].\",\n-    type=float,\n-    default=DEFAULT_SEVERITY_CUTOFF,\n-)\n-args = parser.parse_args()\n-\n-with open(args.sarif_path) as sarif_file:\n-    sarif_data = json.load(sarif_file)\n-\n-first_run = sarif_data[\"runs\"][0]\n-triggered_rules = first_run[\"tool\"][\"driver\"][\"rules\"]\n-\n-exit(  # noqa: WPS421\n-    any(\n-        float(rule[\"properties\"][\"security-severity\"]) >= args.severity_cutoff\n-        for rule in triggered_rules\n-    )\n-)\n", "issue": "bug: No way to dismiss image scan alerts\n### Meltano Version\n\nNA\n\n### Python Version\n\nNA\n\n### Bug scope\n\nOther\n\n### Operating System\n\nNA\n\n### Description\n\nCurrently we use `.github/actions/docker-build-scan-push/check_sarif.py` to analyze the SARIF report created from running `grype` to scan our Docker images. It parses the SARIF JSON file itself to check if there are any issues detected with a severity above some threshold in the range [0.0, 10.0].\r\n\r\nBefore running this check, we upload the SARIF results to GitHub, which stores them for our repository using the \"code scanning\" feature. From there, we can review them, dismiss them, and create issues to address them. [An example can be found here](https://github.com/meltano/meltano/security/code-scanning?query=ref%3Arefs%2Fpull%2F6410%2Fmerge+tool%3AGrype).\r\n\r\nOur `check_sarif.py` script does not consider whether we've dismissed the issue via GitHub's \"code scanning\" feature, so we have no way to deem a detected issue acceptable, and have the Docker publish workflow pass. To fix this we should replace `check_sarif.py` with some steps that use [the GitHub code scanning API](https://docs.github.com/en/rest/code-scanning#list-code-scanning-alerts-for-a-repository) to check if there are any issues above some set severity level *that haven't been dismissed*.\n\n### Code\n\n_No response_\n", "before_files": [{"content": "\"\"\"Check if the provided SARIF file has any violations at or above some severity level.\"\"\"\n\nfrom __future__ import annotations\n\nimport argparse\nimport json\n\nDEFAULT_SEVERITY_CUTOFF = 4.0\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\n    \"sarif_path\",\n    help=\"The path to the SARIF file to be checked.\",\n)\nparser.add_argument(\n    \"--severity-cutoff\",\n    help=\"Violations with a severity >= this value result in an exit code of 1\"\n    + \" - must be a number in the range [0.0, 10.0].\",\n    type=float,\n    default=DEFAULT_SEVERITY_CUTOFF,\n)\nargs = parser.parse_args()\n\nwith open(args.sarif_path) as sarif_file:\n    sarif_data = json.load(sarif_file)\n\nfirst_run = sarif_data[\"runs\"][0]\ntriggered_rules = first_run[\"tool\"][\"driver\"][\"rules\"]\n\nexit(  # noqa: WPS421\n    any(\n        float(rule[\"properties\"][\"security-severity\"]) >= args.severity_cutoff\n        for rule in triggered_rules\n    )\n)\n", "path": ".github/actions/docker-build-scan-push/check_sarif.py"}], "after_files": [{"content": null, "path": ".github/actions/docker-build-scan-push/check_sarif.py"}]}