Skip to content

Commit

Permalink
[ISSUE #2054]💫Optimize auto approve pull requests github action (#2055)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsm authored Jan 3, 2025
1 parent b6a771e commit 0545a8b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/auto_approve_pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
with:
github-token: ${{ secrets.BOT_TOKEN }}
script: |
const retryInterval1 = 300 * 1000; // 300 seconds
await new Promise(resolve => setTimeout(resolve, retryInterval1));
const { owner, repo } = context.repo;
const pr = context.payload.pull_request || context.payload.check_suite.pull_requests[0];
const sha = pr.head.sha;
Expand Down Expand Up @@ -77,10 +80,9 @@ jobs:
console.log('All required status checks have passed successfully');
return true; // All checks passed
}
// Poll for status checks until they complete
const maxRetries = 720;
const retryInterval = 5 * 1000; // 10 seconds
const maxRetries = 20;
const retryInterval = 30 * 1000; // 30 seconds
for (let i = 0; i < maxRetries; i++) {
const allChecksPassed = await checkRequiredStatusChecks();
if (allChecksPassed) {
Expand Down

0 comments on commit 0545a8b

Please sign in to comment.