-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3fbcf2
commit 1b27972
Showing
10 changed files
with
58 additions
and
26 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { pick } from 'lodash/fp'; | ||
import { yellow } from 'chalk'; | ||
import simpleGit, { SimpleGit } from 'simple-git'; | ||
import { logger } from '../helpers/logger'; | ||
import { Module, Env } from '../types'; | ||
|
||
const { log } = logger('git messages'); | ||
|
||
/** | ||
* Get all commit messages between the last hash and now | ||
*/ | ||
export const addRawCommitMessages: Module = async (env: Env) => { | ||
const git: SimpleGit = simpleGit(); | ||
|
||
let data = await git.log({ | ||
from: `${env.lastReleaseHash}^1`, | ||
to: env.currentHash, | ||
}); | ||
|
||
// parsing and enriching | ||
const commitMessages = data.all.map( | ||
pick(['hash', 'date', 'message', 'body']) | ||
); | ||
|
||
log(`${yellow(commitMessages.length)} overall affected commits`); | ||
|
||
return { ...env, commitMessages } as Env; | ||
}; |
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
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
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
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
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
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
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