fix: use updated merge commit sha instead of unknown one (#71)

* fix: use updated merge commit sha instead of unknown one

* chore: run prettier
This commit is contained in:
Samuel Attard 2024-08-08 16:45:33 -04:00 коммит произвёл GitHub
Родитель 94d950dd40
Коммит 4848e76dd8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -498,6 +498,7 @@ webhooks.on(
const octokit = await getOctokit(event.payload.repository.owner.login); const octokit = await getOctokit(event.payload.repository.owner.login);
let mergeableState = event.payload.pull_request.mergeable_state; let mergeableState = event.payload.pull_request.mergeable_state;
let mergeCommitSha = event.payload.pull_request.merge_commit_sha;
let attempt = 0; let attempt = 0;
while ((!mergeableState || mergeableState === 'unknown') && attempt < 10) { while ((!mergeableState || mergeableState === 'unknown') && attempt < 10) {
await new Promise((r) => setTimeout(r, 5000)); await new Promise((r) => setTimeout(r, 5000));
@ -509,13 +510,10 @@ webhooks.on(
pull_number: event.payload.pull_request.number, pull_number: event.payload.pull_request.number,
}); });
mergeableState = pr.data.mergeable_state; mergeableState = pr.data.mergeable_state;
mergeCommitSha = pr.data.merge_commit_sha;
} }
await queueDryRun( await queueDryRun(octokit, mergeCommitSha, event.payload.pull_request.head.sha);
octokit,
event.payload.pull_request.merge_commit_sha,
event.payload.pull_request.head.sha,
);
} }
}), }),
); );