Skip to content

Instantly share code, notes, and snippets.

@jbuck
Created May 15, 2020 17:04
Show Gist options
  • Save jbuck/4d31228b758a6da3b64a5082cf3999e8 to your computer and use it in GitHub Desktop.
Save jbuck/4d31228b758a6da3b64a5082cf3999e8 to your computer and use it in GitHub Desktop.
Heroku apps + latest release in a spreadsheet
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