mirror of
https://github.com/actions/deploy-pages.git
synced 2026-03-30 01:54:52 +00:00
Revert shifted API usage from https://github.com/actions/deploy-pages/pull/136
Fixes https://github.com/actions/deploy-pages/issues/137
This commit is contained in:
23
dist/index.js
vendored
23
dist/index.js
vendored
@@ -1942,10 +1942,6 @@ function checkBypass(reqUrl) {
|
|||||||
if (!reqUrl.hostname) {
|
if (!reqUrl.hostname) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const reqHost = reqUrl.hostname;
|
|
||||||
if (isLoopbackAddress(reqHost)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
|
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
|
||||||
if (!noProxy) {
|
if (!noProxy) {
|
||||||
return false;
|
return false;
|
||||||
@@ -1971,24 +1967,13 @@ function checkBypass(reqUrl) {
|
|||||||
.split(',')
|
.split(',')
|
||||||
.map(x => x.trim().toUpperCase())
|
.map(x => x.trim().toUpperCase())
|
||||||
.filter(x => x)) {
|
.filter(x => x)) {
|
||||||
if (upperNoProxyItem === '*' ||
|
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
|
||||||
upperReqHosts.some(x => x === upperNoProxyItem ||
|
|
||||||
x.endsWith(`.${upperNoProxyItem}`) ||
|
|
||||||
(upperNoProxyItem.startsWith('.') &&
|
|
||||||
x.endsWith(`${upperNoProxyItem}`)))) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
exports.checkBypass = checkBypass;
|
exports.checkBypass = checkBypass;
|
||||||
function isLoopbackAddress(host) {
|
|
||||||
const hostLower = host.toLowerCase();
|
|
||||||
return (hostLower === 'localhost' ||
|
|
||||||
hostLower.startsWith('127.') ||
|
|
||||||
hostLower.startsWith('[::1]') ||
|
|
||||||
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=proxy.js.map
|
//# sourceMappingURL=proxy.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
@@ -9899,7 +9884,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 +9902,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 +9920,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
|
||||||
|
|||||||
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
|
||||||
|
|||||||
@@ -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