Skip to content

Commit

Permalink
Add more debug output.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Dec 5, 2020
1 parent a3f33b4 commit dfd2b82
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions dist/index.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.js.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/automerge-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ export class AutomergeAction {
}

async handlePullRequestReview(): Promise<void> {
core.debug('handlePullRequestReview()')

const { action, review, pull_request: pullRequest } = github.context.payload

if (!action || !review || !pullRequest) {
Expand All @@ -230,6 +232,8 @@ export class AutomergeAction {
}

async handlePullRequestTarget(): Promise<void> {
core.debug('handlePullRequestTarget()')

const { action, label, pull_request: pullRequest } = github.context.payload

if (!action || !pullRequest) {
Expand All @@ -246,6 +250,8 @@ export class AutomergeAction {
}

async handleSchedule(): Promise<void> {
core.debug('handleSchedule()')

const pullRequests = (
await this.octokit.pulls.list({
...github.context.repo,
Expand All @@ -265,6 +271,8 @@ export class AutomergeAction {
}

async handleWorkflowRun(): Promise<void> {
core.debug('handleWorkflowRun()')

const { action, workflow_run: workflowRun } = github.context.payload

if (!action || !workflowRun) {
Expand Down
1 change: 1 addition & 0 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export function commitHasMinimumApprovals(
n: number
): boolean {
const relevantReviews = relevantReviewsForCommit(reviews, reviewAuthorAssociations, commit)
core.debug(`Commit ${commit} has ${relevantReviews.length} relevant reviews.`)

// All last `n` reviews must be approvals.
const lastNReviews = relevantReviews.reverse().slice(0, n)
Expand Down

0 comments on commit dfd2b82

Please sign in to comment.