Skip to content

Instantly share code, notes, and snippets.

@patrickhulce
Created December 1, 2020 16:03
Show Gist options
  • Save patrickhulce/facb48c3a15bad0b36437b29f8e67d0b to your computer and use it in GitHub Desktop.
Save patrickhulce/facb48c3a15bad0b36437b29f8e67d0b to your computer and use it in GitHub Desktop.
Get GitHub logins from commit hashes
const fs = require('fs');
const fetch = require('isomorphic-fetch');
async function go() {
const hashes = fs.readFileSync('hashes.txt', 'utf-8').split('\n');
for (const hash of hashes) {
if (!hash.trim()) continue;
const response = await fetch(`https://api.github.com/repos/GoogleChrome/lighthouse/commits/${hash}`);
const json = await response.json();
console.log(`${hash.slice(0, 8)} was ${json.commit.author.name} (@${json.author.login})`);
}
}
go();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment