Skip to content

Commit 1bfaa15

Browse files
committed
Ooops lol
1 parent 92f1c43 commit 1bfaa15

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

__tests__/labeler.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,14 @@ describe('toMatchConfig', () => {
6767
const config = {
6868
'changed-files': [{'any-glob-to-any-file': ['testing-files']}],
6969
'head-branch': ['testing-head'],
70-
'base-branch': ['testing-base']
70+
'base-branch': ['testing-base'],
71+
authors: ['testing-author']
7172
};
7273
const expected: BaseMatchConfig = {
7374
changedFiles: [{anyGlobToAnyFile: ['testing-files']}],
7475
headBranch: ['testing-head'],
75-
baseBranch: ['testing-base']
76+
baseBranch: ['testing-base'],
77+
authors: ['testing-author']
7678
};
7779

7880
it('returns a MatchConfig object with all options', () => {

dist/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,8 @@ function getLabelConfigMapFromObject(configObject) {
357357
function toMatchConfig(config) {
358358
const changedFilesConfig = (0, changedFiles_1.toChangedFilesMatchConfig)(config);
359359
const branchConfig = (0, branch_1.toBranchMatchConfig)(config);
360-
return Object.assign(Object.assign({}, changedFilesConfig), branchConfig);
360+
const authorsConfig = config['authors'] ? { authors: config['authors'] } : {};
361+
return Object.assign(Object.assign(Object.assign({}, changedFilesConfig), branchConfig), authorsConfig);
361362
}
362363

363364

src/api/get-label-configs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,11 @@ export function getLabelConfigMapFromObject(
129129
export function toMatchConfig(config: any): BaseMatchConfig {
130130
const changedFilesConfig = toChangedFilesMatchConfig(config);
131131
const branchConfig = toBranchMatchConfig(config);
132+
const authorsConfig = config['authors'] ? {authors: config['authors']} : {};
132133

133134
return {
134135
...changedFilesConfig,
135-
...branchConfig
136+
...branchConfig,
137+
...authorsConfig
136138
};
137139
}

0 commit comments

Comments
 (0)