Skip to content

Commit

Permalink
feat: add option autoMerge
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed May 25, 2019
1 parent 534436a commit e418623
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion dist/index-node10-dev.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index-node10-dev.cjs.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion dist/index-node10.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index-node10.cjs.js.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion src/pr-handlers/actions/editOpenedPR.ts
Expand Up @@ -4,6 +4,7 @@ import { RepoContext } from '../../context/repoContext';
import { StatusError, StatusInfo } from '../../teamconfigs/types';
import { cleanTitle } from './utils/cleanTitle';
import { updateBody } from './utils/updateBody';
import { autoMergeIfPossible } from './autoMergeIfPossible';

interface StatusWithInfo {
name: string;
Expand Down Expand Up @@ -178,9 +179,15 @@ export const editOpenedPR = async (
);
}
if (options.autoMerge && !prHasAutoMergeLabel) {
await context.github.issues.addLabels(
const result = await context.github.issues.addLabels(
context.issue({ labels: [automergeLabel.name] }),
);
await autoMergeIfPossible(
context,
repoContext,
context.payload.pull_request,
result.data,
);
}
}
}
Expand Down

0 comments on commit e418623

Please sign in to comment.