File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 1
1
import * as core from '@actions/core'
2
2
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'
4
6
5
7
async function run ( ) : Promise < void > {
6
8
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 )
13
19
} catch ( error ) {
14
20
core . setFailed ( error . message )
15
21
}
You can’t perform that action at this time.
0 commit comments