File tree Expand file tree Collapse file tree 1 file changed +67
-0
lines changed Expand file tree Collapse file tree 1 file changed +67
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Make sure that you set the request to `POST` with URL `https://api.github.com/graphql`
2
+ # Set `Headers` where `Content-Type` is `application/json` and `Accept` is `application/vnd.github.audit-log-preview+json`
3
+
4
+ {
5
+ enterprise (slug : " <enterprise-slug>" ) {
6
+ organizations (first : 100 ){
7
+ nodes {
8
+ auditLog (last : 5 ) {
9
+ edges {
10
+ node {
11
+ ... on AuditEntry {
12
+ # Get Audit Log Entry by 'Action'
13
+ action
14
+ actorLogin
15
+ createdAt
16
+ # User 'Action' was performed on
17
+ user {
18
+ name
19
+ email
20
+ }
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
28
+ }
29
+
30
+ # If you'd like to use environment variables, this is what it would look like:
31
+
32
+ query getAuditLog ($slug : String ! , $numEntries : Int ! , $cursor : String ){
33
+ enterprise (slug : $slug ) {
34
+ organizations (first : 100 ){
35
+ nodes {
36
+ auditLog (last : $numEntries , before : $cursor ) {
37
+ edges {
38
+ node {
39
+ ... on AuditEntry { # Get Audit Log Entry by 'Action'
40
+ action
41
+ actorLogin
42
+ createdAt
43
+ user { # User 'Action' was performed on
44
+ name
45
+ email
46
+ }
47
+ }
48
+ }
49
+ cursor
50
+ }
51
+ pageInfo {
52
+ endCursor
53
+ hasNextPage
54
+ }
55
+ totalCount
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+
62
+ # Envrionment variables:
63
+ {
64
+ "slug" : "<enterprise-slug>" ,
65
+ "numEntries" : 5,
66
+ "cursor" : null
67
+ }
You can’t perform that action at this time.
0 commit comments