mirror of
https://github.com/actions/deploy-pages.git
synced 2026-03-28 08:54:53 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f27bcc1584 | ||
|
|
eb68e76f70 |
13
dist/index.js
vendored
13
dist/index.js
vendored
@@ -9899,7 +9899,7 @@ async function createPagesDeployment({ githubToken, artifactUrl, buildVersion, i
|
|||||||
core.info(`Creating Pages deployment with payload:\n${JSON.stringify(payload, null, '\t')}`)
|
core.info(`Creating Pages deployment with payload:\n${JSON.stringify(payload, null, '\t')}`)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await octokit.request('POST /repos/{owner}/{repo}/pages/deployments', {
|
const response = await octokit.request('POST /repos/{owner}/{repo}/pages/deployment', {
|
||||||
owner: github.context.repo.owner,
|
owner: github.context.repo.owner,
|
||||||
repo: github.context.repo.repo,
|
repo: github.context.repo.repo,
|
||||||
...payload
|
...payload
|
||||||
@@ -9917,7 +9917,7 @@ async function getPagesDeploymentStatus({ githubToken, deploymentId }) {
|
|||||||
|
|
||||||
core.info('Getting Pages deployment status...')
|
core.info('Getting Pages deployment status...')
|
||||||
try {
|
try {
|
||||||
const response = await octokit.request('GET /repos/{owner}/{repo}/pages/deployments/{deploymentId}', {
|
const response = await octokit.request('GET /repos/{owner}/{repo}/pages/deployment/status/{deploymentId}', {
|
||||||
owner: github.context.repo.owner,
|
owner: github.context.repo.owner,
|
||||||
repo: github.context.repo.repo,
|
repo: github.context.repo.repo,
|
||||||
deploymentId
|
deploymentId
|
||||||
@@ -9935,7 +9935,7 @@ async function cancelPagesDeployment({ githubToken, deploymentId }) {
|
|||||||
|
|
||||||
core.info('Canceling Pages deployment...')
|
core.info('Canceling Pages deployment...')
|
||||||
try {
|
try {
|
||||||
const response = await octokit.request('POST /repos/{owner}/{repo}/pages/deployments/{deploymentId}/cancel', {
|
const response = await octokit.request('PUT /repos/{owner}/{repo}/pages/deployment/cancel/{deploymentId}', {
|
||||||
owner: github.context.repo.owner,
|
owner: github.context.repo.owner,
|
||||||
repo: github.context.repo.repo,
|
repo: github.context.repo.repo,
|
||||||
deploymentId
|
deploymentId
|
||||||
@@ -10017,6 +10017,7 @@ const temporaryErrorStatus = {
|
|||||||
|
|
||||||
const finalErrorStatus = {
|
const finalErrorStatus = {
|
||||||
deployment_failed: 'Deployment failed, try again later.',
|
deployment_failed: 'Deployment failed, try again later.',
|
||||||
|
deployment_perms_error: 'Deployment failed. Please ensure that the file permissions are correct.',
|
||||||
deployment_content_failed:
|
deployment_content_failed:
|
||||||
'Artifact could not be deployed. Please ensure the content does not contain any hard links, symlinks and total size is less than 10GB.',
|
'Artifact could not be deployed. Please ensure the content does not contain any hard links, symlinks and total size is less than 10GB.',
|
||||||
deployment_cancelled: 'Deployment cancelled.',
|
deployment_cancelled: 'Deployment cancelled.',
|
||||||
@@ -10079,9 +10080,6 @@ class Deployment {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.error(error.stack)
|
core.error(error.stack)
|
||||||
|
|
||||||
// output raw error in debug mode.
|
|
||||||
core.debug(JSON.stringify(error))
|
|
||||||
|
|
||||||
// build customized error message based on server response
|
// build customized error message based on server response
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
let errorMessage = `Failed to create deployment (status: ${error.status}) with build version ${this.buildVersion}. `
|
let errorMessage = `Failed to create deployment (status: ${error.status}) with build version ${this.buildVersion}. `
|
||||||
@@ -10162,9 +10160,6 @@ class Deployment {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.error(error.stack)
|
core.error(error.stack)
|
||||||
|
|
||||||
// output raw error in debug mode.
|
|
||||||
core.debug(JSON.stringify(error))
|
|
||||||
|
|
||||||
// build customized error message based on server response
|
// build customized error message based on server response
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
errorStatus = error.status || error.response.status
|
errorStatus = error.status || error.response.status
|
||||||
|
|||||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -113,7 +113,7 @@ async function createPagesDeployment({ githubToken, artifactUrl, buildVersion, i
|
|||||||
core.info(`Creating Pages deployment with payload:\n${JSON.stringify(payload, null, '\t')}`)
|
core.info(`Creating Pages deployment with payload:\n${JSON.stringify(payload, null, '\t')}`)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await octokit.request('POST /repos/{owner}/{repo}/pages/deployments', {
|
const response = await octokit.request('POST /repos/{owner}/{repo}/pages/deployment', {
|
||||||
owner: github.context.repo.owner,
|
owner: github.context.repo.owner,
|
||||||
repo: github.context.repo.repo,
|
repo: github.context.repo.repo,
|
||||||
...payload
|
...payload
|
||||||
@@ -131,7 +131,7 @@ async function getPagesDeploymentStatus({ githubToken, deploymentId }) {
|
|||||||
|
|
||||||
core.info('Getting Pages deployment status...')
|
core.info('Getting Pages deployment status...')
|
||||||
try {
|
try {
|
||||||
const response = await octokit.request('GET /repos/{owner}/{repo}/pages/deployments/{deploymentId}', {
|
const response = await octokit.request('GET /repos/{owner}/{repo}/pages/deployment/status/{deploymentId}', {
|
||||||
owner: github.context.repo.owner,
|
owner: github.context.repo.owner,
|
||||||
repo: github.context.repo.repo,
|
repo: github.context.repo.repo,
|
||||||
deploymentId
|
deploymentId
|
||||||
@@ -149,7 +149,7 @@ async function cancelPagesDeployment({ githubToken, deploymentId }) {
|
|||||||
|
|
||||||
core.info('Canceling Pages deployment...')
|
core.info('Canceling Pages deployment...')
|
||||||
try {
|
try {
|
||||||
const response = await octokit.request('POST /repos/{owner}/{repo}/pages/deployments/{deploymentId}/cancel', {
|
const response = await octokit.request('PUT /repos/{owner}/{repo}/pages/deployment/cancel/{deploymentId}', {
|
||||||
owner: github.context.repo.owner,
|
owner: github.context.repo.owner,
|
||||||
repo: github.context.repo.repo,
|
repo: github.context.repo.repo,
|
||||||
deploymentId
|
deploymentId
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ const temporaryErrorStatus = {
|
|||||||
|
|
||||||
const finalErrorStatus = {
|
const finalErrorStatus = {
|
||||||
deployment_failed: 'Deployment failed, try again later.',
|
deployment_failed: 'Deployment failed, try again later.',
|
||||||
|
deployment_perms_error: 'Deployment failed. Please ensure that the file permissions are correct.',
|
||||||
deployment_content_failed:
|
deployment_content_failed:
|
||||||
'Artifact could not be deployed. Please ensure the content does not contain any hard links, symlinks and total size is less than 10GB.',
|
'Artifact could not be deployed. Please ensure the content does not contain any hard links, symlinks and total size is less than 10GB.',
|
||||||
deployment_cancelled: 'Deployment cancelled.',
|
deployment_cancelled: 'Deployment cancelled.',
|
||||||
@@ -79,9 +80,6 @@ class Deployment {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.error(error.stack)
|
core.error(error.stack)
|
||||||
|
|
||||||
// output raw error in debug mode.
|
|
||||||
core.debug(JSON.stringify(error))
|
|
||||||
|
|
||||||
// build customized error message based on server response
|
// build customized error message based on server response
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
let errorMessage = `Failed to create deployment (status: ${error.status}) with build version ${this.buildVersion}. `
|
let errorMessage = `Failed to create deployment (status: ${error.status}) with build version ${this.buildVersion}. `
|
||||||
@@ -162,9 +160,6 @@ class Deployment {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.error(error.stack)
|
core.error(error.stack)
|
||||||
|
|
||||||
// output raw error in debug mode.
|
|
||||||
core.debug(JSON.stringify(error))
|
|
||||||
|
|
||||||
// build customized error message based on server response
|
// build customized error message based on server response
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
errorStatus = error.status || error.response.status
|
errorStatus = error.status || error.response.status
|
||||||
|
|||||||
@@ -100,13 +100,13 @@ describe('Deployment', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const createDeploymentScope = nock('https://api.github.com')
|
const createDeploymentScope = nock('https://api.github.com')
|
||||||
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, {
|
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployment`, {
|
||||||
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent',
|
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent',
|
||||||
pages_build_version: process.env.GITHUB_SHA,
|
pages_build_version: process.env.GITHUB_SHA,
|
||||||
oidc_token: fakeJwt
|
oidc_token: fakeJwt
|
||||||
})
|
})
|
||||||
.reply(200, {
|
.reply(200, {
|
||||||
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
|
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployment/status/${process.env.GITHUB_SHA}`,
|
||||||
page_url: 'https://actions.github.io/is-awesome'
|
page_url: 'https://actions.github.io/is-awesome'
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -138,14 +138,14 @@ describe('Deployment', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const createDeploymentScope = nock('https://api.github.com')
|
const createDeploymentScope = nock('https://api.github.com')
|
||||||
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, {
|
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployment`, {
|
||||||
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent',
|
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent',
|
||||||
pages_build_version: process.env.GITHUB_SHA,
|
pages_build_version: process.env.GITHUB_SHA,
|
||||||
oidc_token: fakeJwt,
|
oidc_token: fakeJwt,
|
||||||
preview: true
|
preview: true
|
||||||
})
|
})
|
||||||
.reply(200, {
|
.reply(200, {
|
||||||
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
|
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployment/status/${process.env.GITHUB_SHA}`,
|
||||||
page_url: 'https://actions.github.io/is-awesome',
|
page_url: 'https://actions.github.io/is-awesome',
|
||||||
preview_url: 'https://actions.drafts.github.io/is-awesome'
|
preview_url: 'https://actions.drafts.github.io/is-awesome'
|
||||||
})
|
})
|
||||||
@@ -192,7 +192,7 @@ describe('Deployment', () => {
|
|||||||
.reply(200, { value: [{ url: 'https://invalid-artifact.com', name: 'github-pages' }] })
|
.reply(200, { value: [{ url: 'https://invalid-artifact.com', name: 'github-pages' }] })
|
||||||
|
|
||||||
const createDeploymentScope = nock('https://api.github.com')
|
const createDeploymentScope = nock('https://api.github.com')
|
||||||
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, {
|
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployment`, {
|
||||||
artifact_url: 'https://invalid-artifact.com&%24expand=SignedContent',
|
artifact_url: 'https://invalid-artifact.com&%24expand=SignedContent',
|
||||||
pages_build_version: process.env.GITHUB_SHA
|
pages_build_version: process.env.GITHUB_SHA
|
||||||
})
|
})
|
||||||
@@ -225,18 +225,18 @@ describe('Deployment', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const createDeploymentScope = nock('https://api.github.com')
|
const createDeploymentScope = nock('https://api.github.com')
|
||||||
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, {
|
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployment`, {
|
||||||
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent',
|
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent',
|
||||||
pages_build_version: process.env.GITHUB_SHA,
|
pages_build_version: process.env.GITHUB_SHA,
|
||||||
oidc_token: fakeJwt
|
oidc_token: fakeJwt
|
||||||
})
|
})
|
||||||
.reply(200, {
|
.reply(200, {
|
||||||
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
|
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployment/status/${process.env.GITHUB_SHA}`,
|
||||||
page_url: 'https://actions.github.io/is-awesome'
|
page_url: 'https://actions.github.io/is-awesome'
|
||||||
})
|
})
|
||||||
|
|
||||||
const deploymentStatusScope = nock('https://api.github.com')
|
const deploymentStatusScope = nock('https://api.github.com')
|
||||||
.get(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`)
|
.get(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployment/status/${process.env.GITHUB_SHA}`)
|
||||||
.reply(200, {
|
.reply(200, {
|
||||||
status: 'succeed'
|
status: 'succeed'
|
||||||
})
|
})
|
||||||
@@ -279,18 +279,18 @@ describe('Deployment', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const createDeploymentScope = nock('https://api.github.com')
|
const createDeploymentScope = nock('https://api.github.com')
|
||||||
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`, {
|
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployment`, {
|
||||||
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent',
|
artifact_url: 'https://fake-artifact.com&%24expand=SignedContent',
|
||||||
pages_build_version: process.env.GITHUB_SHA,
|
pages_build_version: process.env.GITHUB_SHA,
|
||||||
oidc_token: fakeJwt
|
oidc_token: fakeJwt
|
||||||
})
|
})
|
||||||
.reply(200, {
|
.reply(200, {
|
||||||
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
|
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployment/status/${process.env.GITHUB_SHA}`,
|
||||||
page_url: 'https://actions.github.io/is-awesome'
|
page_url: 'https://actions.github.io/is-awesome'
|
||||||
})
|
})
|
||||||
|
|
||||||
const cancelDeploymentScope = nock('https://api.github.com')
|
const cancelDeploymentScope = nock('https://api.github.com')
|
||||||
.post(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}/cancel`)
|
.put(`/repos/${process.env.GITHUB_REPOSITORY}/pages/deployment/cancel/${process.env.GITHUB_SHA}`)
|
||||||
.reply(200, {})
|
.reply(200, {})
|
||||||
|
|
||||||
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
|
core.getIDToken = jest.fn().mockResolvedValue(fakeJwt)
|
||||||
|
|||||||
Reference in New Issue
Block a user