Skip to content

Commit 7215eac

Browse files
committed
Implement main function
1 parent 455a211 commit 7215eac

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/main.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
import * as core from '@actions/core'
22
import * as io from '@actions/io'
3-
import {Settings} from './settings'
3+
import {Changelog} from './changelog'
4+
import {Git} from './git'
5+
import {initSettings, Settings} from './settings'
46

57
async function run(): Promise<void> {
68
try {
7-
const settings = {} as Settings
8-
settings.gitPath = await io.which('git', true)
9-
settings.repoPath = core.getInput('path') || '.'
10-
settings.tagRegex = core.getInput('tag-regex') || ''
11-
settings.filterRegex = core.getInput('filter-regex') || ''
12-
settings.changelogFilePath = core.getInput('changelog_file_path') || ''
9+
const settings = await initSettings()
10+
11+
const g = new Git(settings)
12+
const to = await g.currentTag()
13+
const from = await g.previousTag(to)
14+
15+
const log = await g.log(from, to)
16+
17+
const changelog = new Changelog(settings)
18+
await changelog.write(log)
1319
} catch (error) {
1420
core.setFailed(error.message)
1521
}

0 commit comments

Comments
 (0)