chore: consolidate some code
This commit is contained in:
@@ -5,7 +5,7 @@ import getComments from './lib/get_comments.mjs';
|
||||
import getPull from './lib/get_pull.mjs';
|
||||
import getCommits from './lib/get_commits.mjs';
|
||||
import getCommitStatus from './lib/get_commit_status.mjs';
|
||||
import { createComment, deleteComment } from './lib/comments.mjs';
|
||||
import createPullComment from './lib/create_pull_comment.mjs';
|
||||
import History from './lib/history.mjs';
|
||||
|
||||
// load env vars from .env file
|
||||
@@ -80,12 +80,9 @@ async function ghActionBot() {
|
||||
}
|
||||
|
||||
await Promise.all(
|
||||
records.map(async record => {
|
||||
logger.log(`Re-testing PR #${record.pull.number}`);
|
||||
const comment = await createComment(repo, records[0].pull.number, PULL_RETEST_BODY);
|
||||
logger.debug(`Created comment id ${comment.id}`);
|
||||
await deleteComment(repo, comment.id);
|
||||
})
|
||||
records.map(record =>
|
||||
createPullComment(repo, record.pull.number, PULL_RETEST_BODY, { delete: true })
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user