Is it possible to retrieve the audit-log in github.com via the API?

本小妞迷上赌 提交于 2019-12-10 02:38:28

问题


I found nothing in the API docs, only the enterprise version mentions that you can retrieve the audit-logs using the staff-tools.

Any idea? I'd love to periodically check the audit log and send the new entries to our IM channel (ChatOps).

Thanks in advance,


回答1:


As VonC points out, there is no API (as of October 2017).

Unfortunately the "Export" function in the GitHub audit logs produces JSON or CSV of the audit events but the data is missing the payload with the details.

For example the export would show that an issue_comment.update had been made but the web UI gives a link to the comment itself. The export would show that one user executed org.update_member on another user but the web UI would show what role change was made for that user.

To get the details of each event, at the moment (October 2017), the only way is via the web UI.

Here is a ruby tool which scrapes the web UI, fetching the audit log entries with details.




回答2:


Not yet possible through the GitHub API.

But at least, it is possible to export it (since May, 5th 2015) in either JSON or CSV format.

See "Exporting the audit log".



来源:https://stackoverflow.com/questions/28578477/is-it-possible-to-retrieve-the-audit-log-in-github-com-via-the-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!