mirror of
https://github.com/actions/github-script.git
synced 2026-02-07 19:47:26 +00:00
Override the retryAfterBaseValue
This commit is contained in:
parent
e778eeb4a7
commit
2ca00a18c2
3 changed files with 19 additions and 4 deletions
13
.github/workflows/integration.yml
vendored
13
.github/workflows/integration.yml
vendored
|
|
@ -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
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,2 +1,4 @@
|
|||
/node_modules/
|
||||
!/.vscode/
|
||||
!/.vscode/
|
||||
.DS_Store
|
||||
.env
|
||||
|
|
@ -5,7 +5,7 @@ import { RequestRequestOptions } from '@octokit/types'
|
|||
export type RetryOptions = {
|
||||
doNotRetry?: number[]
|
||||
enabled?: boolean
|
||||
delay?: number
|
||||
retryAfterBaseValue?: number
|
||||
}
|
||||
|
||||
export function getRetryOptions(
|
||||
|
|
@ -23,7 +23,7 @@ export function getRetryOptions(
|
|||
}
|
||||
|
||||
if (retryAfter > 0) {
|
||||
retryOptions.delay = retryAfter
|
||||
retryOptions.retryAfterBaseValue = retryAfter
|
||||
}
|
||||
|
||||
if (exemptStatusCodes.length > 0) {
|
||||
|
|
@ -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]'
|
||||
})`
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue