Created
May 15, 2020 17:04
-
-
Save jbuck/4d31228b758a6da3b64a5082cf3999e8 to your computer and use it in GitHub Desktop.
Heroku apps + latest release in a spreadsheet
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 Heroku = require('heroku-client') | |
const heroku = new Heroku({ token: process.env.HEROKU_API_TOKEN }) | |
const main = async () => { | |
const apps = (await heroku.get(`/apps`)).map(m => { return { created_at: m.created_at, name: m.name, stack: m.stack.name } }) | |
console.log(['App Name', 'Created At', 'Stack', 'Version', 'Description', 'Released At', 'User'].join('\t')) | |
for (app of apps) { | |
const releases = await heroku.get(`/apps/${app.name}/releases`) | |
const r = releases.pop() | |
console.log([app.name, app.created_at, app.stack, r.version, r.description, r.created_at, r.user.email].join('\t')) | |
} | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment