Over the past couple of weeks we've seen a couple of great examples of service integrations from figshare and Zenodo that use the GitHub outbound API to automatically archive GitHub repositories. While the implementation of each solution is likely to be somewhat different I thought it might be useful to write up in general terms how to go about building such a service.
In a nutshell we need a tool that does the following:
- Authenticates against the GitHub API
- Configures an outbound API endpoint for repository events to be posted to
- Respond to a GitHub repository event by grabbing a copy of the code
- Issues a DOI for the code bundle