Skip to content

Commit

Permalink
feat: add since option to change start date filter (#54)
Browse files Browse the repository at this point in the history
* feat: add since option

* docs: update readme
  • Loading branch information
adrianiy committed Oct 19, 2021
1 parent eadb9de commit 9cf88dc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,20 +172,20 @@ There are two available commands `generate` and `publish`.
Generates Release Note markdown

Opciones:
--version Muestra número de versión [booleano]
--help Muestra ayuda [booleano]
-c, --configuration Configuration file path [cadena de caracteres]
-o, --output, --out Output path [cadena de caracteres]
-n, --name Output file name [cadena de caracteres]
-a, --auth Manual creadentials input [booleano]
-r, --repo Repo in format user/repo [cadena de caracteres]
-f, --filter Filter to apply in Pull request query
[cadena de caracteres]
-m, --message Commit message [cadena de caracteres]
-p, --publish Publish output to your repo [booleano]
--assets File to upload in publish process [cadena de caracteres]
-v, --verbose Makes the script verbose [booleano]
-i, --interactive Executes interactive version of the script [booleano]
--version Show version number [boolean]
--help Show help [boolean]
-c, --configuration Configuration file path [string]
-o, --output, --out Output path [string]
-n, --name Output file name [string]
-a, --auth Manual creadentials input [boolean]
-r, --repo Repo in format user/repo [string]
-f, --filter Filter to apply in Pull request query [string]
-s, --since Start date in pull request filter query [string]
-m, --message Commit message [string]
-p, --publish Publish output to your repo [boolean]
--assets File to upload in publish process [string]
-v, --verbose Makes the script verbose [boolean]
-i, --interactive Executes interactive version of the script [boolean]
```

###### Publish
Expand Down
5 changes: 5 additions & 0 deletions src/commander/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ export const repoOptions: Record<string, Options> = {
type: 'string',
description: 'Filter to apply in Pull request query',
},
since: {
alias: 's',
type: 'string',
description: 'Start date in pull request filter query',
},
message: {
alias: 'm',
type: 'string',
Expand Down
2 changes: 2 additions & 0 deletions src/configuration/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export interface Configuration {
ignoredLabels?: string[];
// PR query filter
filter?: string;
// Start date in pull request filter query
since?: string;
// Split Release-Notes on file per Relase
// This option will create a folder in `out` dir.
split?: boolean;
Expand Down
4 changes: 4 additions & 0 deletions src/connector/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export class GitHubConnector extends Connector {
}

async getLatestRelease(): Promise<Release> {
if (this._configuration.since) {
return { createdAt: this._configuration.since, tagName: 'mock' };
}

this._verbose && logger.info('Getting latest release...');

const query = releaseQuery.loc!.source.body;
Expand Down

0 comments on commit 9cf88dc

Please sign in to comment.