Module: Octokit::Client::CodeScanning
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/code_scanning.rb
Overview
Methods for the code scanning alerts API
Instance Method Summary collapse
-
#delete_code_scanning_analysis(repo, analysis_id, options = {}) ⇒ Sawyer::Resource
Delete a specified code scanning analysis from a repository.
-
#get_code_scanning_alert(repo, alert_number, options = {}) ⇒ Sawyer::Resource
Gets a single code scanning alert.
-
#get_code_scanning_analysis(repo, analysis_id, options = {}) ⇒ Sawyer::Resource
Get a code scanning analysis for a repository.
-
#get_code_scanning_default_config(repo, options = {}) ⇒ Sawyer::Resource
Get Code Scanning Default Configuration.
-
#get_codeql_database_for_repo(repo, language, options = {}) ⇒ Sawyer::Resource
Gets a CodeQL database for a language in a repository.
-
#get_sarif_upload_information(repo, sarif_id, options = {}) ⇒ Sawyer::Resource
Gets information about a SARIF upload.
-
#list_code_scanning_alerts_for_org(org, options = {}) ⇒ Array
List code scanning alerts for an organization.
-
#list_code_scanning_alerts_for_repo(repo, options = {}) ⇒ Array
List code scanning alerts for a repository.
-
#list_code_scanning_analysis(repo, options = {}) ⇒ Array
List code scanning analyses for a repository.
-
#list_codeql_database_for_repo(repo, options = {}) ⇒ Array
Lists the CodeQL databases that are available in a repository.
-
#list_instances_of_code_scanning_alert(repo, alert_number, options = {}) ⇒ Array
List instances of a code scanning alert.
-
#update_code_scanning_alert(repo, alert_number, state, reason, comment = nil, options = {}) ⇒ Sawyer::Resource
Update a code scanning alert.
-
#update_code_scanning_default_config(repo, state, query_suite = nil, languages = nil, options = {}) ⇒ Sawyer::Resource
Updates a code scanning default setup configuration.
-
#upload_sarif_data(repo, file, sha, ref, options = {}) ⇒ Sawyer::Resource
Uploads SARIF data containing the results of a code scanning analysis.
Instance Method Details
#delete_code_scanning_analysis(repo, analysis_id, options = {}) ⇒ Sawyer::Resource
Delete a specified code scanning analysis from a repository
67 68 69 |
# File 'lib/octokit/client/code_scanning.rb', line 67 def delete_code_scanning_analysis(repo, analysis_id, = {}) delete "#{Repository.path repo}/code-scanning/analyses/#{analysis_id}", end |
#get_code_scanning_alert(repo, alert_number, options = {}) ⇒ Sawyer::Resource
Gets a single code scanning alert
126 127 128 |
# File 'lib/octokit/client/code_scanning.rb', line 126 def get_code_scanning_alert(repo, alert_number, = {}) get "#{Repository.path repo}/code-scanning/alerts/#{alert_number}", end |
#get_code_scanning_analysis(repo, analysis_id, options = {}) ⇒ Sawyer::Resource
Get a code scanning analysis for a repository
78 79 80 |
# File 'lib/octokit/client/code_scanning.rb', line 78 def get_code_scanning_analysis(repo, analysis_id, = {}) get "#{Repository.path repo}/code-scanning/analyses/#{analysis_id}", end |
#get_code_scanning_default_config(repo, options = {}) ⇒ Sawyer::Resource
Get Code Scanning Default Configuration
35 36 37 |
# File 'lib/octokit/client/code_scanning.rb', line 35 def get_code_scanning_default_config(repo, = {}) get "#{Repository.path repo}/code-scanning/default-setup", end |
#get_codeql_database_for_repo(repo, language, options = {}) ⇒ Sawyer::Resource
Gets a CodeQL database for a language in a repository
46 47 48 |
# File 'lib/octokit/client/code_scanning.rb', line 46 def get_codeql_database_for_repo(repo, language, = {}) get "#{Repository.path repo}/code-scanning/codeql/databases/#{language}", end |
#get_sarif_upload_information(repo, sarif_id, options = {}) ⇒ Sawyer::Resource
Gets information about a SARIF upload
174 175 176 |
# File 'lib/octokit/client/code_scanning.rb', line 174 def get_sarif_upload_information(repo, sarif_id, = {}) get "#{Repository.path repo}/code-scanning/sarifs/#{sarif_id}", end |
#list_code_scanning_alerts_for_org(org, options = {}) ⇒ Array
List code scanning alerts for an organization
146 147 148 |
# File 'lib/octokit/client/code_scanning.rb', line 146 def list_code_scanning_alerts_for_org(org, = {}) paginate "orgs/#{org}/code-scanning/alerts", end |
#list_code_scanning_alerts_for_repo(repo, options = {}) ⇒ Array
List code scanning alerts for a repository
136 137 138 |
# File 'lib/octokit/client/code_scanning.rb', line 136 def list_code_scanning_alerts_for_repo(repo, = {}) paginate "#{Repository.path repo}/code-scanning/alerts", end |
#list_code_scanning_analysis(repo, options = {}) ⇒ Array
List code scanning analyses for a repository
88 89 90 |
# File 'lib/octokit/client/code_scanning.rb', line 88 def list_code_scanning_analysis(repo, = {}) paginate "#{Repository.path repo}/code-scanning/analyses", end |
#list_codeql_database_for_repo(repo, options = {}) ⇒ Array
Lists the CodeQL databases that are available in a repository
56 57 58 |
# File 'lib/octokit/client/code_scanning.rb', line 56 def list_codeql_database_for_repo(repo, = {}) get "#{Repository.path repo}/code-scanning/codeql/databases", end |
#list_instances_of_code_scanning_alert(repo, alert_number, options = {}) ⇒ Array
List instances of a code scanning alert
99 100 101 |
# File 'lib/octokit/client/code_scanning.rb', line 99 def list_instances_of_code_scanning_alert(repo, alert_number, = {}) paginate "#{Repository.path repo}/code-scanning/alerts/#{alert_number}/instances", end |
#update_code_scanning_alert(repo, alert_number, state, reason, comment = nil, options = {}) ⇒ Sawyer::Resource
Update a code scanning alert
111 112 113 114 115 116 117 |
# File 'lib/octokit/client/code_scanning.rb', line 111 def update_code_scanning_alert(repo, alert_number, state, reason, comment = nil, = {}) [:state] = state [:dismissed_reason] = reason [:dismissed_comment] = comment if comment patch "#{Repository.path repo}/code-scanning/alerts/#{alert_number}", end |
#update_code_scanning_default_config(repo, state, query_suite = nil, languages = nil, options = {}) ⇒ Sawyer::Resource
Updates a code scanning default setup configuration
21 22 23 24 25 26 27 |
# File 'lib/octokit/client/code_scanning.rb', line 21 def update_code_scanning_default_config(repo, state, query_suite = nil, languages = nil, = {}) [:state] = state [:query_suite] = query_suite if query_suite [:languages] = languages if languages patch "#{Repository.path repo}/code-scanning/default-setup", end |
#upload_sarif_data(repo, file, sha, ref, options = {}) ⇒ Sawyer::Resource
Uploads SARIF data containing the results of a code scanning analysis
159 160 161 162 163 164 165 |
# File 'lib/octokit/client/code_scanning.rb', line 159 def upload_sarif_data(repo, file, sha, ref, = {}) [:sarif] = compress_sarif_data(file) [:commit_sha] = sha [:ref] = ref post "#{Repository.path repo}/code-scanning/sarifs", end |