@@ -236,7 +236,7 @@ export type PackageRegistryOptions = {
|
|||||||
token: string
|
token: string
|
||||||
// Optional parameters for the write operation.
|
// Optional parameters for the write operation.
|
||||||
// The number of times to retry the request.
|
// The number of times to retry the request.
|
||||||
customRetry?: number
|
retryAttempts?: number
|
||||||
// HTTP headers to include in request to Artifact Metadata API.
|
// HTTP headers to include in request to Artifact Metadata API.
|
||||||
headers?: RequestHeaders
|
headers?: RequestHeaders
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export type PackageRegistryOptions = {
|
|||||||
* @param artifactOptions - parameters for the storage record API request.
|
* @param artifactOptions - parameters for the storage record API request.
|
||||||
* @param packageRegistryOptions - parameters for the package registry API request.
|
* @param packageRegistryOptions - parameters for the package registry API request.
|
||||||
* @param token - GitHub token used to authenticate the request.
|
* @param token - GitHub token used to authenticate the request.
|
||||||
* @param retry - The number of retries to attempt if the request fails.
|
* @param retryAttempts - The number of retries to attempt if the request fails.
|
||||||
* @param headers - Additional headers to include in the request.
|
* @param headers - Additional headers to include in the request.
|
||||||
*
|
*
|
||||||
* @returns The ID of the storage record.
|
* @returns The ID of the storage record.
|
||||||
@@ -47,10 +47,10 @@ export async function createStorageRecord(
|
|||||||
artifactOptions: ArtifactOptions,
|
artifactOptions: ArtifactOptions,
|
||||||
packageRegistryOptions: PackageRegistryOptions,
|
packageRegistryOptions: PackageRegistryOptions,
|
||||||
token: string,
|
token: string,
|
||||||
customRetry?: number,
|
retryAttempts?: number,
|
||||||
headers?: RequestHeaders
|
headers?: RequestHeaders
|
||||||
): Promise<number[]> {
|
): Promise<number[]> {
|
||||||
const retries = customRetry ?? DEFAULT_RETRY_COUNT
|
const retries = retryAttempts ?? DEFAULT_RETRY_COUNT
|
||||||
const octokit = github.getOctokit(token, {retry: {retries}}, retry)
|
const octokit = github.getOctokit(token, {retry: {retries}}, retry)
|
||||||
try {
|
try {
|
||||||
const response = await octokit.request(CREATE_STORAGE_RECORD_REQUEST, {
|
const response = await octokit.request(CREATE_STORAGE_RECORD_REQUEST, {
|
||||||
|
|||||||
Reference in New Issue
Block a user