mirror of
https://github.com/maciejpedzich/playlist-entry-validator.git
synced 2024-11-28 00:15:48 +01:00
Don't close a pull request approval
This commit is contained in:
parent
da5b67a642
commit
cdbbbd6403
9
bot.ts
9
bot.ts
@ -22,10 +22,12 @@ const bot: ApplicationFunction = (app) => {
|
||||
const removePathFromFilename = (filename: string) =>
|
||||
filename.replace(registryDirectoryPath, '');
|
||||
|
||||
type ReviewEvent = 'REQUEST_CHANGES' | 'COMMENT' | 'APPROVE';
|
||||
|
||||
const upsertReview = async (
|
||||
review_id: number | undefined,
|
||||
body: string,
|
||||
event: 'REQUEST_CHANGES' | 'COMMENT'
|
||||
event: ReviewEvent
|
||||
) => {
|
||||
if (review_id) {
|
||||
await context.octokit.pulls.updateReview({
|
||||
@ -114,7 +116,7 @@ const bot: ApplicationFunction = (app) => {
|
||||
let renameRequiredText = '';
|
||||
let notFoundText = '';
|
||||
let successText = `🎉 @${workingRepo.owner} can merge your pull request! 🎉`;
|
||||
let reviewEvent: 'REQUEST_CHANGES' | 'COMMENT' = 'COMMENT';
|
||||
let reviewEvent: ReviewEvent = 'APPROVE';
|
||||
|
||||
if (validEntries.length > 0) {
|
||||
const playlistLinks = validEntries
|
||||
@ -163,7 +165,8 @@ const bot: ApplicationFunction = (app) => {
|
||||
if (
|
||||
renameRequiredText === '' &&
|
||||
notFoundText === '' &&
|
||||
existingReview?.id
|
||||
existingReview?.id &&
|
||||
existingReview?.state !== 'APPROVED'
|
||||
) {
|
||||
await context.octokit.pulls.dismissReview({
|
||||
...workingRepo,
|
||||
|
Loading…
Reference in New Issue
Block a user