Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to query GitHub's audit log with GraphQL
query {
organization(login: "se-saml") {
auditLog(first: 50) {
edges {
node {
... on RepositoryAuditEntryData {
repository {
name
}
}
... on OrganizationAuditEntryData {
organization {
name
}
}
... on TeamAuditEntryData {
teamName
}
... on BusinessAuditEntryData {
businessUrl
}
... on OauthApplicationAuditEntryData {
oauthApplicationName
}
... on AuditEntry {
actorResourcePath
action
actorIp
actorLogin
createdAt
actorLocation {
countryCode
country
regionCode
region
city
}
}
}
cursor
}
}
}
}
@jonico

This comment has been minimized.

Copy link
Owner Author

jonico commented Jun 6, 2019

In order for this to work, you need to add an Accept-Header with value application/vnd.github.audit-log-preview+json

@brianamarie

This comment has been minimized.

Copy link

brianamarie commented Sep 24, 2019

I've opened a pull request to add this to platform-samples: github/platform-samples#262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.