-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
26 lines (20 loc) · 1.02 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /usr/bin/env node
import createMdContent from "./utils/createMdContent.js"
import fetchUsablePulls from "./utils/fetchUsablePulls.js"
import getPreviousDate from "./utils/getPreviousDate.js"
import getPreviousVersion from "./utils/getPreviousVersion.js"
import createRuntimeConfig from "./utils/createRuntimeConfig.js"
import { octoInit } from "./utils/octo.js"
import writeOut from './utils/writeOut.js'
const runtimeConfig = createRuntimeConfig()
if (!runtimeConfig.repository) throw 'No repository given! Aborting.'
octoInit(runtimeConfig.ghtoken)
if (!runtimeConfig.previousVersion) {
runtimeConfig.previousVersion = await getPreviousVersion(runtimeConfig)
console.debug(`No previous version set. Using latest release ${runtimeConfig.previousVersion}\n`)
}
const previousDate = await getPreviousDate(runtimeConfig)
console.debug('previousDate ', previousDate)
const usablePulls = await fetchUsablePulls(runtimeConfig, previousDate)
const fileContent = createMdContent(runtimeConfig, usablePulls)
writeOut(runtimeConfig, fileContent)