-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrequests.http
More file actions
146 lines (107 loc) · 3.76 KB
/
Copy pathrequests.http
File metadata and controls
146 lines (107 loc) · 3.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
### ServiceNow Invokes the GitHub App
POST http://localhost:9684/handle_snow_request
Content-Type: application/json
{
"pull_request_url": "https://github.com/KatieZemon/sampleOpsRepo/pull/22",
"installation_id": 35679500
}
### Webhook Event was triggered by: A comment "/snow" was added to a pull request
POST http://localhost:9684/mywebhook
Content-Type: application/json
X-GitHub-Event: issue_comment
X-Github-Delivery: the delivery
{
"event": "issue_comment",
"action": "created",
"comment": {
"body": "/snow"
},
"repository": {
"full_name": "KatieZemon/sampleOpsRepo"
},
"issue": {
"number": 1
},
"installation": {
"id": 35679500
}
}
### GitHub API: Get PR Details
GET https://api.github.com/repos/KatieZemon/sampleOpsRepo/pulls/12
Accept: application/vnd.github+json
Authorization: Bearer {auth_token}
Content-Type: application/json
### GitHub API: Get list of required checks
GET https://api.github.com/repos/KatieZemon/sampleOpsRepo/branches/main/protection/required_status_checks
Accept: application/vnd.github+json
Authorization: Bearer {auth_token}
Content-Type: application/json
### GitHub API: Get check run
GET https://api.github.com/repos/KatieZemon/sampleOpsRepo/check-runs/12376392396
Accept: application/vnd.github+json
Authorization: Bearer {auth_token}
Content-Type: application/json
### GitHub API: Post comment on pull request
POST https://api.github.com/repos/KatieZemon/sampleOpsRepo/issues/1/comments
Accept: application/vnd.github+json
Authorization: Bearer {auth_token}
Content-Type: application/json
{
"body": "This is a comment 12345!"
}
### GitHub API: Create a Check Run
# Use the context parameter in the API call when creating check runs Set context value
POST https://api.github.com/repos/KatieZemon/sampleOpsRepo/check-runs
Accept: application/vnd.github+json
Authorization: Bearer {auth_token}
Content-Type: application/json
{
"name":"katie-timeout-check",
"head_sha":"c625413bba4378e472c8bbdc1b08db931f761a02",
"status":"in_progress",
"external_id":"42",
"started_at":"2018-05-04T01:14:52Z",
"output":{"title":"Mighty Readme report","summary":"asdf","text":"asdf"}
}
### GitHub API: Create a Check Run
# From https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28
# action_required shows as failure with a resolve button
# failure shows as failure
# neutral just a gray box
# success Looks like check mark
# skipped
POST https://api.github.com/repos/KatieZemon/sampleOpsRepo/check-runs
Accept: application/vnd.github+json
Authorization: Bearer {auth_token}
Content-Type: application/json
{
"name":"katie-check2",
"head_sha":"c625413bba4378e472c8bbdc1b08db931f761a02",
"status":"completed",
"external_id":"42",
"started_at":"2023-03-27T01:14:52Z",
"completed_at":"2023-03-27T01:20:52Z",
"conclusion": "failure",
"output":{"title":"Mighty Readme report","summary":"This is a sample summary","text":"Some sample text"}
}
### GitHub API: Update a Check Run
PATCH https://api.github.com/repos/KatieZemon/sampleOpsRepo/check-runs/12339947871
Accept: application/vnd.github+json
Authorization: Bearer {auth_token}
Content-Type: application/json
{
"status":"in_progress"
}
### GitHub API: List check runs for a Git Reference
# Returns all check runs for a given branch
# https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#list-check-runs-for-a-git-reference
GET https://api.github.com/repos/KatieZemon/sampleOpsRepo/commits/KatieZemon-patch-1/check-runs
Accept: application/vnd.github+json
Authorization: Bearer {auth_token}
X-GitHub-Api-Version: 2022-11-28
### GitHub API: Generate app installation access token
POST https://api.github.com/app/installations/35679500/access_tokens
Accept: application/vnd.github+json
Authorization: Bearer {auth_token}
X-GitHub-Api-Version: 2022-11-28
###