main
master
). You must use an access token with the security_events
scope to usesecurity_events
read permission to usecurl --location --request GET 'https://api.github.com/repos///code-scanning/alerts'
[
{
"classification": "source",
"created_at": "2019-08-24T14:15:22Z",
"dismissed_at": "2019-08-24T14:15:22Z",
"dismissed_by": {
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"gravatar_id": "41d064eb2195891e12d0413f63227ea7",
"html_url": "https://github.com/octocat",
"id": 1,
"login": "octocat",
"node_id": "MDQ6VXNlcjE=",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"repos_url": "https://api.github.com/users/octocat/repos",
"site_admin": true,
"starred_at": "\"2020-07-09T00:17:55Z\"",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/octocat"
},
"dismissed_reason": null,
"html_url": "http://example.com",
"instance": {
"analysis_key": "string",
"classifications": [
"source"
],
"commit_sha": "string",
"environment": "string",
"html_url": "string",
"location": {
"end_column": 0,
"end_line": 0,
"path": "string",
"start_column": 0,
"start_line": 0
},
"message": {
"text": "string"
},
"ref": "string",
"state": "open"
},
"number": 0,
"rule": {
"description": "string",
"id": "string",
"name": "string",
"severity": "none"
},
"state": "open",
"tool": {
"guid": "string",
"name": "string",
"version": "string"
},
"url": "http://example.com"
}
]
Authorization: Bearer ********************
tool_name
or tool_guid
, but not both.tool_guid
or tool_name
, but not both.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
.open
, fixed
, or dismissed
to list code scanning alerts in a specific state.YYYY-MM-DDTHH:MM:SSZ
.YYYY-MM-DDTHH:MM:SSZ
.false positive
, won't fix
, and used in tests
.refs/heads/<branch name>
,refs/pull/<number>/merge
, or refs/pull/<number>/head
.【GitHub】API开发者 微信交流群
用微信扫右侧二维码,加入【GitHub】API开发者 交流群,互助沟通