Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: renovate adds labels after opening pr
- Loading branch information
1 parent
ed6bd2f
commit 5bc57e0
Showing
3 changed files
with
34 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Webhooks from '@octokit/webhooks'; | ||
import { Context } from 'probot'; | ||
import { RepoContext } from '../../context/repoContext'; | ||
import { autoMergeIfPossible } from './autoMergeIfPossible'; | ||
|
||
export const autoApproveAndAutoMerge = async ( | ||
context: Context<Webhooks.WebhookPayloadPullRequest>, | ||
repoContext: RepoContext, | ||
): Promise<void> => { | ||
// const autoMergeLabel = repoContext.labels['merge/automerge']; | ||
const codeApprovedLabel = repoContext.labels['code/approved']; | ||
const prLabels = context.payload.pull_request.labels; | ||
if (prLabels.find((l): boolean => l.id === codeApprovedLabel.id)) { | ||
await context.github.pulls.createReview( | ||
context.issue({ event: 'APPROVE' }), | ||
); | ||
} | ||
|
||
await autoMergeIfPossible(context, repoContext); | ||
}; |
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