Created
December 1, 2020 16:03
-
-
Save patrickhulce/facb48c3a15bad0b36437b29f8e67d0b to your computer and use it in GitHub Desktop.
Get GitHub logins from commit hashes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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