chore: Retry labeling release PRs
This commit is contained in:
parent
90796c08c0
commit
04b3d2328c
|
@ -27,6 +27,9 @@ jobs:
|
|||
with:
|
||||
github-token: ${{secrets.YOSHI_APPROVER_TOKEN}}
|
||||
script: |
|
||||
let found = false;
|
||||
for (let tries = 3; tries > 0; tries--) {
|
||||
await new Promise(r => setTimeout(r, 2000));
|
||||
const prs = await github.pulls.list({
|
||||
owner: 'googleapis',
|
||||
repo: 'google-api-ruby-client',
|
||||
|
@ -35,7 +38,6 @@ jobs:
|
|||
direction: 'desc',
|
||||
per_page: 10
|
||||
});
|
||||
var found = false;
|
||||
prs.data.forEach(function(pr) {
|
||||
if (found || pr.user.login != "yoshi-code-bot" || !pr.title.startsWith("Release ")) {
|
||||
return;
|
||||
|
@ -67,7 +69,9 @@ jobs:
|
|||
}
|
||||
core.info("AutoApprove: complete!");
|
||||
found = true;
|
||||
tries = 0;
|
||||
});
|
||||
if (!found) {
|
||||
core.setFailed("Unable to find release PR.");
|
||||
}
|
||||
if (!found) {
|
||||
core.setFailed("Unable to find release PR after 3 tries.");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue