-
I have an app that listens for Sometimes someone will switch the branch that is being merged into, or there will be a network error, and for whatever reason I would like to be able to re-run all the checks as if the I was thinking of triggering this re-run when someone makes a comment like "retest" on the PR, which would be The problem is that all my functions downstream of
My questions:
app.on(['pull_request.opened', 'pull_request.synchronize'], async context => {
// unpack params
// discard all the PR info that came from the hook.
await mainPullRequestChecks({ owner: repoOwner, repo: repoName, pull_number: pullNumber })
}
app.on(['issue_comment.created'], async context => {
// unpack params
// Check for special string in comment to retest.
await mainPullRequestChecks({ owner: repoOwner, repo: repoName, pull_number: pullNumber })
}
function mainPullRequestChecks (owner: string, repo: string, pull_number: number) {
// Now we only deal with one type but add an extra API call to every event.
const pullRequest = await context.octokit.rest.pulls.get(
{ owner: repoOwner, repo: repoName, pull_number: pullNumber }
)
// All checks below
} My dependencies
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I just realized that adding
Hopefully someone else finds this rubberduck session helpful. |
Beta Was this translation helpful? Give feedback.
I just realized that adding
'pull_request.reopened'
as a trigger would probably be an easy way to deal with this. A developer could close a PR than reopen it to re-run tests.I could even possibly add a probot-command to do it automatically if someone entered a command like
/retest
app.on(['pull_request.opened', 'pull_request.synchronize', 'pull_request.reopened'], async context => {
Hopefully someone else finds this rubberduck session helpful.