mirror of
https://github.com/actions/toolkit.git
synced 2026-08-20 00:00:14 +02:00
new user-agent string for storage record API reqs
Signed-off-by: Brian DeHamer <[email protected]>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as github from '@actions/github'
|
||||
import {retry} from '@octokit/plugin-retry'
|
||||
import {RequestHeaders} from '@octokit/types'
|
||||
import {getUserAgent} from './internal/utils.js'
|
||||
|
||||
const CREATE_STORAGE_RECORD_REQUEST =
|
||||
'POST /orgs/{owner}/artifacts/metadata/storage-record'
|
||||
@@ -52,10 +53,16 @@ export async function createStorageRecord(
|
||||
): Promise<number[]> {
|
||||
const retries = retryAttempts ?? DEFAULT_RETRY_COUNT
|
||||
const octokit = github.getOctokit(token, {retry: {retries}}, retry)
|
||||
|
||||
const headersWithUserAgent = {
|
||||
'user-agent': getUserAgent(),
|
||||
...headers
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await octokit.request(CREATE_STORAGE_RECORD_REQUEST, {
|
||||
owner: github.context.repo.owner,
|
||||
headers,
|
||||
headers: headersWithUserAgent,
|
||||
...buildRequestParams(artifactOptions, packageRegistryOptions)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user