1
0
Fork 0
mirror of https://github.com/actions/toolkit synced 2025-05-09 16:43:02 +00:00

rewrite artifacts client to have public and internal implementations

This commit is contained in:
Rob Herley 2023-11-30 03:47:04 +00:00 committed by GitHub
parent 0787a93181
commit 695bf98f84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 1149 additions and 254 deletions

View file

@ -2,7 +2,7 @@ import * as core from '@actions/core'
import {UploadOptions, UploadResponse} from '../shared/interfaces'
import {getExpiration} from './retention'
import {validateArtifactName} from './path-and-artifact-name-validation'
import {createArtifactTwirpClient} from '../shared/artifact-twirp-client'
import {internalArtifactTwirpClient} from '../shared/artifact-twirp-client'
import {
UploadZipSpecification,
getUploadZipSpecification,
@ -44,21 +44,9 @@ export async function uploadArtifact(
// get the IDs needed for the artifact creation
const backendIds = getBackendIdsFromToken()
if (!backendIds.workflowRunBackendId || !backendIds.workflowJobRunBackendId) {
core.warning(
`Failed to get the necessary backend ids which are required to create the artifact`
)
return {
success: false
}
}
core.debug(`Workflow Run Backend ID: ${backendIds.workflowRunBackendId}`)
core.debug(
`Workflow Job Run Backend ID: ${backendIds.workflowJobRunBackendId}`
)
// create the artifact client
const artifactClient = createArtifactTwirpClient('upload')
const artifactClient = internalArtifactTwirpClient()
// create the artifact
const createArtifactReq: CreateArtifactRequest = {