Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Override the retryAfterBaseValue
  • Loading branch information
mauriziovitale committed Mar 28, 2023
commit 2ca00a18c2a3077e1b10405825687e40bcec2036
13 changes: 13 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,16 @@ jobs:
if [[ "${{steps.output-set.outputs.result}}" != "@actions/core" ]]; then
exit 1
fi

test-retry-after:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Test retry with after
uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
retries: 3
retry-after: 999
script: |
console.log('Exec the plugin', context.repo.owner);
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/node_modules/
!/.vscode/
!/.vscode/
.DS_Store
.env
6 changes: 3 additions & 3 deletions src/retry-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { RequestRequestOptions } from '@octokit/types'
export type RetryOptions = {
doNotRetry?: number[]
enabled?: boolean
delay?: number
retryAfterBaseValue?: number
}

export function getRetryOptions(
Expand All @@ -23,7 +23,7 @@ export function getRetryOptions(
}

if (retryAfter > 0) {
retryOptions.delay = retryAfter
retryOptions.retryAfterBaseValue = retryAfter
}

if (exemptStatusCodes.length > 0) {
Expand All @@ -40,7 +40,7 @@ export function getRetryOptions(

core.debug(
`GitHub client configured with: (retries: ${requestOptions.retries
}, retryAfter: ${retryOptions.delay ?? 'octokit default: 1000'
}, retryAfterBaseValue: ${retryOptions.retryAfterBaseValue ?? 'octokit default: 1000'
} retry-exempt-status-code: ${retryOptions?.doNotRetry ?? 'octokit default: [400, 401, 403, 404, 422]'
})`
)
Expand Down