Is it possible to retrieve the audit-log in github

2019-04-24 01:39发布

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,

2条回答
混吃等死
2楼-- · 2019-04-24 02:08

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.

https://cloud.githubusercontent.com/assets/79995/7376703/66f8b8d2-ed96-11e4-9258-9caacdb60b7c.png

See "Exporting the audit log".

查看更多
我想做一个坏孩纸
3楼-- · 2019-04-24 02:21

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.

查看更多
登录 后发表回答