View Source GitHub.CodeScanning (GitHub REST API Client v0.0.13)

Provides API endpoints related to code scanning

Link to this section Summary

Functions

Delete a code scanning analysis from a repository

Get a code scanning analysis for a repository

Get a CodeQL database for a repository

Get a code scanning default setup configuration

Get information about a SARIF upload

List instances of a code scanning alert

List code scanning alerts for an organization

List code scanning alerts for a repository

List CodeQL databases for a repository

List code scanning analyses for a repository

Update a code scanning default setup configuration

Upload an analysis as SARIF data

Link to this section Functions

Link to this function

delete_analysis(owner, repo, analysis_id, opts \\ [])

View Source
@spec delete_analysis(String.t(), String.t(), integer(), keyword()) ::
  {:ok, GitHub.CodeScanning.AnalysisDeletion.t()} | {:error, GitHub.Error.t()}

Delete a code scanning analysis from a repository

options

Options

  • confirm_delete (String.t() | nil): Allow deletion if the specified analysis is the last in a set. If you attempt to delete the final analysis in a set without setting this parameter to true, you'll get a 400 response with the message: Analysis is last of its type and deletion may result in the loss of historical alert data. Please specify confirm_delete.

resources

Resources

Link to this function

get_alert(owner, repo, alert_number, opts \\ [])

View Source
@spec get_alert(String.t(), String.t(), integer(), keyword()) ::
  {:ok, GitHub.CodeScanning.Alert.t()} | {:error, GitHub.Error.t()}

Get a code scanning alert

resources

Resources

Link to this function

get_analysis(owner, repo, analysis_id, opts \\ [])

View Source
@spec get_analysis(String.t(), String.t(), integer(), keyword()) ::
  {:ok, GitHub.CodeScanning.Analysis.t()} | {:error, GitHub.Error.t()}

Get a code scanning analysis for a repository

resources

Resources

Link to this function

get_codeql_database(owner, repo, language, opts \\ [])

View Source
@spec get_codeql_database(String.t(), String.t(), String.t(), keyword()) ::
  {:ok, GitHub.CodeScanning.CodeqlDatabase.t()} | {:error, GitHub.Error.t()}

Get a CodeQL database for a repository

resources

Resources

Link to this function

get_default_setup(owner, repo, opts \\ [])

View Source
@spec get_default_setup(String.t(), String.t(), keyword()) ::
  {:ok, GitHub.CodeScanning.DefaultSetup.t()} | {:error, GitHub.Error.t()}

Get a code scanning default setup configuration

resources

Resources

Link to this function

get_sarif(owner, repo, sarif_id, opts \\ [])

View Source
@spec get_sarif(String.t(), String.t(), String.t(), keyword()) ::
  {:ok, GitHub.CodeScanning.SarifsStatus.t()} | {:error, GitHub.Error.t()}

Get information about a SARIF upload

resources

Resources

Link to this function

list_alert_instances(owner, repo, alert_number, opts \\ [])

View Source
@spec list_alert_instances(String.t(), String.t(), integer(), keyword()) ::
  {:ok, [GitHub.CodeScanning.AlertInstance.t()]} | {:error, GitHub.Error.t()}

List instances of a code scanning alert

options

Options

  • page (integer): Page number of the results to fetch.
  • per_page (integer): The number of results per page (max 100).
  • ref (String.t()): The Git reference for the results you want to list. The ref for a branch can be formatted either as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge.

resources

Resources

Link to this function

list_alerts_for_org(org, opts \\ [])

View Source
@spec list_alerts_for_org(
  String.t(),
  keyword()
) ::
  {:ok, [GitHub.CodeScanning.OrganizationAlertItems.t()]}
  | {:error, GitHub.Error.t()}

List code scanning alerts for an organization

options

Options

  • tool_name (String.t()): The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either tool_name or tool_guid, but not both.
  • tool_guid (String.t() | nil): The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either tool_guid or tool_name, but not both.

  • before (String.t()): A cursor, as given in the Link header. If specified, the query only searches for results before this cursor.
  • after (String.t()): A cursor, as given in the Link header. If specified, the query only searches for results after this cursor.
  • page (integer): Page number of the results to fetch.
  • per_page (integer): The number of results per page (max 100).
  • direction (String.t()): The direction to sort the results by.
  • state (String.t()): If specified, only code scanning alerts with this state will be returned.
  • sort (String.t()): The property by which to sort the results.
  • severity (String.t()): If specified, only code scanning alerts with this severity will be returned.

resources

Resources

Link to this function

list_alerts_for_repo(owner, repo, opts \\ [])

View Source
@spec list_alerts_for_repo(String.t(), String.t(), keyword()) ::
  {:ok, [GitHub.CodeScanning.AlertItems.t()]} | {:error, GitHub.Error.t()}

List code scanning alerts for a repository

options

Options

  • tool_name (String.t()): The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either tool_name or tool_guid, but not both.
  • tool_guid (String.t() | nil): The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either tool_guid or tool_name, but not both.

  • page (integer): Page number of the results to fetch.
  • per_page (integer): The number of results per page (max 100).
  • ref (String.t()): The Git reference for the results you want to list. The ref for a branch can be formatted either as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge.
  • direction (String.t()): The direction to sort the results by.
  • sort (String.t()): The property by which to sort the results.
  • state (String.t()): If specified, only code scanning alerts with this state will be returned.
  • severity (String.t()): If specified, only code scanning alerts with this severity will be returned.

resources

Resources

Link to this function

list_codeql_databases(owner, repo, opts \\ [])

View Source
@spec list_codeql_databases(String.t(), String.t(), keyword()) ::
  {:ok, [GitHub.CodeScanning.CodeqlDatabase.t()]} | {:error, GitHub.Error.t()}

List CodeQL databases for a repository

resources

Resources

Link to this function

list_recent_analyses(owner, repo, opts \\ [])

View Source
@spec list_recent_analyses(String.t(), String.t(), keyword()) ::
  {:ok, [GitHub.CodeScanning.Analysis.t()]} | {:error, GitHub.Error.t()}

List code scanning analyses for a repository

options

Options

  • tool_name (String.t()): The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either tool_name or tool_guid, but not both.
  • tool_guid (String.t() | nil): The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either tool_guid or tool_name, but not both.

  • page (integer): Page number of the results to fetch.
  • per_page (integer): The number of results per page (max 100).
  • ref (String.t()): The Git reference for the analyses you want to list. The ref for a branch can be formatted either as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge.
  • sarif_id (String.t()): Filter analyses belonging to the same SARIF upload.
  • direction (String.t()): The direction to sort the results by.
  • sort (String.t()): The property by which to sort the results.

resources

Resources

Link to this function

update_alert(owner, repo, alert_number, body, opts \\ [])

View Source
@spec update_alert(String.t(), String.t(), integer(), map(), keyword()) ::
  {:ok, GitHub.CodeScanning.Alert.t()} | {:error, GitHub.Error.t()}

Update a code scanning alert

resources

Resources

Link to this function

update_default_setup(owner, repo, body, opts \\ [])

View Source

Update a code scanning default setup configuration

resources

Resources

Link to this function

upload_sarif(owner, repo, body, opts \\ [])

View Source
@spec upload_sarif(String.t(), String.t(), map(), keyword()) ::
  {:ok, GitHub.CodeScanning.SarifsReceipt.t()} | {:error, GitHub.Error.t()}

Upload an analysis as SARIF data

resources

Resources