This commit is contained in:
Konrad Pabjan
2023-10-27 16:34:41 -04:00
parent 38d3e68bdc
commit 961a4a1557
4 changed files with 13 additions and 19 deletions

View File

@@ -54,15 +54,16 @@ async function processRuntimeResponse(res, requestOptions) {
return response
}
async function getArtifactMetadata({githubToken, runId, artifactName}) {
async function getArtifactMetadata({ githubToken, runId, artifactName }) {
const octokit = github.getOctokit(githubToken)
try {
const response = await octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts?name={artifactName}', {
console.log(`Fetching artifact metadata for run ${runId}...`)
const response = await octokit.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts', {
owner: github.context.repo.owner,
repo: github.context.repo.repo,
run_id: runId,
artifactName: artifactName
run_id: runId
})
return response.data

View File

@@ -2,11 +2,7 @@ const core = require('@actions/core')
// All variables we need from the runtime are loaded here
const getContext = require('./context')
const {
getArtifactMetadata,
getPagesDeploymentStatus,
cancelPagesDeployment
} = require('./api-client')
const { getArtifactMetadata, getPagesDeploymentStatus, cancelPagesDeployment } = require('./api-client')
const temporaryErrorStatus = {
unknown_status: 'Unable to get deployment status.',