mirror of
https://github.com/actions/deploy-pages.git
synced 2026-03-28 17:04:53 +00:00
Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0745e9700c | ||
|
|
43dced9e8c | ||
|
|
fce105b3ea | ||
|
|
148e2ea9dd | ||
|
|
506f839b97 | ||
|
|
f7a158aceb | ||
|
|
ca23c7917e | ||
|
|
0c60998bd5 | ||
|
|
4154a47b87 | ||
|
|
17fd28439d | ||
|
|
0f19a8f78c | ||
|
|
595c840e2a | ||
|
|
57f2f8bd29 | ||
|
|
68c14dcd2c | ||
|
|
a7af90c328 | ||
|
|
ef910bd895 | ||
|
|
53f4e898cd | ||
|
|
62c650c70d | ||
|
|
eaf36f48c9 | ||
|
|
01f6ae5af2 | ||
|
|
82cb77089c | ||
|
|
ad36b7023a | ||
|
|
32b8b86ff0 | ||
|
|
a598b2af14 | ||
|
|
f511fa4665 | ||
|
|
0e157789db | ||
|
|
12940a5b99 | ||
|
|
6afc4f2884 | ||
|
|
a68b5a4ae1 | ||
|
|
171a8a05dd | ||
|
|
7a1dc4e394 | ||
|
|
92f6725bee | ||
|
|
e1279a88ef | ||
|
|
479e82243a | ||
|
|
243ed8c2df | ||
|
|
c2e0577d92 |
38
.github/release-drafter.yml
vendored
Normal file
38
.github/release-drafter.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name-template: 'v$RESOLVED_VERSION'
|
||||||
|
tag-template: 'v$RESOLVED_VERSION'
|
||||||
|
template: |
|
||||||
|
# Changelog
|
||||||
|
$CHANGES
|
||||||
|
See details of [all code changes](https://github.com/actions/jekyll-build-pages/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release
|
||||||
|
categories:
|
||||||
|
- title: '🚀 Features'
|
||||||
|
labels:
|
||||||
|
- 'feature'
|
||||||
|
- 'enhancement'
|
||||||
|
- title: '🐛 Bug Fixes'
|
||||||
|
labels:
|
||||||
|
- 'fix'
|
||||||
|
- 'bugfix'
|
||||||
|
- 'bug'
|
||||||
|
- title: '🧰 Maintenance'
|
||||||
|
labels:
|
||||||
|
- 'infrastructure'
|
||||||
|
- 'automation'
|
||||||
|
- 'documentation'
|
||||||
|
- title: '🏎 Performance'
|
||||||
|
label: 'performance'
|
||||||
|
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
||||||
|
version-resolver:
|
||||||
|
major:
|
||||||
|
labels:
|
||||||
|
- 'type: breaking'
|
||||||
|
minor:
|
||||||
|
labels:
|
||||||
|
- 'type: enhancement'
|
||||||
|
patch:
|
||||||
|
labels:
|
||||||
|
- 'type: bug'
|
||||||
|
- 'type: maintenance'
|
||||||
|
- 'type: documentation'
|
||||||
|
default: patch
|
||||||
9
.github/workflows/check-dist.yml
vendored
9
.github/workflows/check-dist.yml
vendored
@@ -37,8 +37,13 @@ jobs:
|
|||||||
- name: Compare the expected and actual dist/ directories
|
- name: Compare the expected and actual dist/ directories
|
||||||
run: |
|
run: |
|
||||||
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
||||||
echo "Detected uncommitted changes after build. See status below:"
|
echo "Detected uncommitted changes after build in dist folder. See status below:"
|
||||||
|
git diff
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$(git diff --ignore-space-at-eol pre/ | wc -l)" -gt "0" ]; then
|
||||||
|
echo "Detected uncommitted changes after build in pre folder. See status below:"
|
||||||
git diff
|
git diff
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
id: diff
|
|
||||||
|
|||||||
70
.github/workflows/codeql-analysis.yml
vendored
Normal file
70
.github/workflows/codeql-analysis.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# For most projects, this workflow file will not need changing; you simply need
|
||||||
|
# to commit it to your repository.
|
||||||
|
#
|
||||||
|
# You may wish to alter this file to override the set of languages analyzed,
|
||||||
|
# or to provide custom queries or build logic.
|
||||||
|
#
|
||||||
|
# ******** NOTE ********
|
||||||
|
# We have attempted to detect the languages in your repository. Please check
|
||||||
|
# the `language` matrix defined below to confirm you have the correct set of
|
||||||
|
# supported CodeQL languages.
|
||||||
|
#
|
||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [ main ]
|
||||||
|
schedule:
|
||||||
|
- cron: '40 0 * * 1'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'javascript' ]
|
||||||
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||||
|
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
|
# By default, queries listed here will override any specified in a config file.
|
||||||
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
|
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 https://git.io/JvXDl
|
||||||
|
|
||||||
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||||
|
# and modify them (or add more) to build your code if your project
|
||||||
|
# uses a compiled language
|
||||||
|
|
||||||
|
#- run: |
|
||||||
|
# make bootstrap
|
||||||
|
# make release
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
28
.github/workflows/release-new-action-version.yml
vendored
Normal file
28
.github/workflows/release-new-action-version.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Release new action version
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [edited]
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
TAG_NAME:
|
||||||
|
description: 'Tag name that the major tag will point to'
|
||||||
|
required: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update_tag:
|
||||||
|
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
|
||||||
|
environment:
|
||||||
|
name: releaseNewActionVersion
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Update the ${{ env.TAG_NAME }} tag
|
||||||
|
id: update-major-tag
|
||||||
|
uses: actions/publish-action@v0.1.0
|
||||||
|
with:
|
||||||
|
source-tag: ${{ env.TAG_NAME }}
|
||||||
|
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@@ -19,6 +19,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run test
|
run: npm run test
|
||||||
|
# Drafts your next Release notes as Pull Requests are merged into "main"
|
||||||
|
- uses: release-drafter/release-drafter@v5
|
||||||
|
if: github.ref_name == 'main'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
11
action.yml
11
action.yml
@@ -3,8 +3,11 @@ description: 'A GitHub Action to deploy an artifact to GitHub Pages'
|
|||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node16'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
pre: 'pre/index.js'
|
|
||||||
inputs:
|
inputs:
|
||||||
|
emit_telemetry:
|
||||||
|
description: 'Should this action only emit build telemetry instead of deploying the build artifact?'
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
token:
|
token:
|
||||||
description: 'GitHub token'
|
description: 'GitHub token'
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
@@ -18,9 +21,9 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
default: "10"
|
default: "10"
|
||||||
reporting_interval:
|
reporting_interval:
|
||||||
description: 'Time in milliseconds between two deployment status report (default: 1 second)'
|
description: 'Time in milliseconds between two deployment status report (default: 5 seconds)'
|
||||||
required: false
|
required: false
|
||||||
default: "1000"
|
default: "5000"
|
||||||
outputs:
|
outputs:
|
||||||
page_url:
|
page_url:
|
||||||
description: 'URL to deployed Github Pages'
|
description: 'URL to deployed GitHub Pages'
|
||||||
|
|||||||
216
dist/index.js
vendored
216
dist/index.js
vendored
@@ -5068,7 +5068,7 @@ events.forEach(function (event) {
|
|||||||
// Error types with codes
|
// Error types with codes
|
||||||
var RedirectionError = createErrorType(
|
var RedirectionError = createErrorType(
|
||||||
"ERR_FR_REDIRECTION_FAILURE",
|
"ERR_FR_REDIRECTION_FAILURE",
|
||||||
""
|
"Redirected request failed"
|
||||||
);
|
);
|
||||||
var TooManyRedirectsError = createErrorType(
|
var TooManyRedirectsError = createErrorType(
|
||||||
"ERR_FR_TOO_MANY_REDIRECTS",
|
"ERR_FR_TOO_MANY_REDIRECTS",
|
||||||
@@ -5219,10 +5219,16 @@ RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
|
|||||||
|
|
||||||
// Stops a timeout from triggering
|
// Stops a timeout from triggering
|
||||||
function clearTimer() {
|
function clearTimer() {
|
||||||
|
// Clear the timeout
|
||||||
if (self._timeout) {
|
if (self._timeout) {
|
||||||
clearTimeout(self._timeout);
|
clearTimeout(self._timeout);
|
||||||
self._timeout = null;
|
self._timeout = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clean up all attached listeners
|
||||||
|
self.removeListener("abort", clearTimer);
|
||||||
|
self.removeListener("error", clearTimer);
|
||||||
|
self.removeListener("response", clearTimer);
|
||||||
if (callback) {
|
if (callback) {
|
||||||
self.removeListener("timeout", callback);
|
self.removeListener("timeout", callback);
|
||||||
}
|
}
|
||||||
@@ -5246,8 +5252,9 @@ RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
|
|||||||
|
|
||||||
// Clean up on events
|
// Clean up on events
|
||||||
this.on("socket", destroyOnTimeout);
|
this.on("socket", destroyOnTimeout);
|
||||||
this.once("response", clearTimer);
|
this.on("abort", clearTimer);
|
||||||
this.once("error", clearTimer);
|
this.on("error", clearTimer);
|
||||||
|
this.on("response", clearTimer);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
@@ -5379,84 +5386,101 @@ RedirectableRequest.prototype._processResponse = function (response) {
|
|||||||
// the user agent MAY automatically redirect its request to the URI
|
// the user agent MAY automatically redirect its request to the URI
|
||||||
// referenced by the Location field value,
|
// referenced by the Location field value,
|
||||||
// even if the specific status code is not understood.
|
// even if the specific status code is not understood.
|
||||||
|
|
||||||
|
// If the response is not a redirect; return it as-is
|
||||||
var location = response.headers.location;
|
var location = response.headers.location;
|
||||||
if (location && this._options.followRedirects !== false &&
|
if (!location || this._options.followRedirects === false ||
|
||||||
statusCode >= 300 && statusCode < 400) {
|
statusCode < 300 || statusCode >= 400) {
|
||||||
// Abort the current request
|
|
||||||
abortRequest(this._currentRequest);
|
|
||||||
// Discard the remainder of the response to avoid waiting for data
|
|
||||||
response.destroy();
|
|
||||||
|
|
||||||
// RFC7231§6.4: A client SHOULD detect and intervene
|
|
||||||
// in cyclical redirections (i.e., "infinite" redirection loops).
|
|
||||||
if (++this._redirectCount > this._options.maxRedirects) {
|
|
||||||
this.emit("error", new TooManyRedirectsError());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// RFC7231§6.4: Automatic redirection needs to done with
|
|
||||||
// care for methods not known to be safe, […]
|
|
||||||
// RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
|
|
||||||
// the request method from POST to GET for the subsequent request.
|
|
||||||
if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
|
|
||||||
// RFC7231§6.4.4: The 303 (See Other) status code indicates that
|
|
||||||
// the server is redirecting the user agent to a different resource […]
|
|
||||||
// A user agent can perform a retrieval request targeting that URI
|
|
||||||
// (a GET or HEAD request if using HTTP) […]
|
|
||||||
(statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
|
|
||||||
this._options.method = "GET";
|
|
||||||
// Drop a possible entity and headers related to it
|
|
||||||
this._requestBodyBuffers = [];
|
|
||||||
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Drop the Host header, as the redirect might lead to a different host
|
|
||||||
var previousHostName = removeMatchingHeaders(/^host$/i, this._options.headers) ||
|
|
||||||
url.parse(this._currentUrl).hostname;
|
|
||||||
|
|
||||||
// Create the redirected request
|
|
||||||
var redirectUrl = url.resolve(this._currentUrl, location);
|
|
||||||
debug("redirecting to", redirectUrl);
|
|
||||||
this._isRedirect = true;
|
|
||||||
var redirectUrlParts = url.parse(redirectUrl);
|
|
||||||
Object.assign(this._options, redirectUrlParts);
|
|
||||||
|
|
||||||
// Drop the Authorization header if redirecting to another host
|
|
||||||
if (redirectUrlParts.hostname !== previousHostName) {
|
|
||||||
removeMatchingHeaders(/^authorization$/i, this._options.headers);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Evaluate the beforeRedirect callback
|
|
||||||
if (typeof this._options.beforeRedirect === "function") {
|
|
||||||
var responseDetails = { headers: response.headers };
|
|
||||||
try {
|
|
||||||
this._options.beforeRedirect.call(null, this._options, responseDetails);
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
this.emit("error", err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._sanitizeOptions(this._options);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Perform the redirected request
|
|
||||||
try {
|
|
||||||
this._performRequest();
|
|
||||||
}
|
|
||||||
catch (cause) {
|
|
||||||
var error = new RedirectionError("Redirected request failed: " + cause.message);
|
|
||||||
error.cause = cause;
|
|
||||||
this.emit("error", error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// The response is not a redirect; return it as-is
|
|
||||||
response.responseUrl = this._currentUrl;
|
response.responseUrl = this._currentUrl;
|
||||||
response.redirects = this._redirects;
|
response.redirects = this._redirects;
|
||||||
this.emit("response", response);
|
this.emit("response", response);
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
this._requestBodyBuffers = [];
|
this._requestBodyBuffers = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The response is a redirect, so abort the current request
|
||||||
|
abortRequest(this._currentRequest);
|
||||||
|
// Discard the remainder of the response to avoid waiting for data
|
||||||
|
response.destroy();
|
||||||
|
|
||||||
|
// RFC7231§6.4: A client SHOULD detect and intervene
|
||||||
|
// in cyclical redirections (i.e., "infinite" redirection loops).
|
||||||
|
if (++this._redirectCount > this._options.maxRedirects) {
|
||||||
|
this.emit("error", new TooManyRedirectsError());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// RFC7231§6.4: Automatic redirection needs to done with
|
||||||
|
// care for methods not known to be safe, […]
|
||||||
|
// RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
|
||||||
|
// the request method from POST to GET for the subsequent request.
|
||||||
|
if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
|
||||||
|
// RFC7231§6.4.4: The 303 (See Other) status code indicates that
|
||||||
|
// the server is redirecting the user agent to a different resource […]
|
||||||
|
// A user agent can perform a retrieval request targeting that URI
|
||||||
|
// (a GET or HEAD request if using HTTP) […]
|
||||||
|
(statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
|
||||||
|
this._options.method = "GET";
|
||||||
|
// Drop a possible entity and headers related to it
|
||||||
|
this._requestBodyBuffers = [];
|
||||||
|
removeMatchingHeaders(/^content-/i, this._options.headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Drop the Host header, as the redirect might lead to a different host
|
||||||
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
||||||
|
|
||||||
|
// If the redirect is relative, carry over the host of the last request
|
||||||
|
var currentUrlParts = url.parse(this._currentUrl);
|
||||||
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
||||||
|
var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
|
||||||
|
url.format(Object.assign(currentUrlParts, { host: currentHost }));
|
||||||
|
|
||||||
|
// Determine the URL of the redirection
|
||||||
|
var redirectUrl;
|
||||||
|
try {
|
||||||
|
redirectUrl = url.resolve(currentUrl, location);
|
||||||
|
}
|
||||||
|
catch (cause) {
|
||||||
|
this.emit("error", new RedirectionError(cause));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the redirected request
|
||||||
|
debug("redirecting to", redirectUrl);
|
||||||
|
this._isRedirect = true;
|
||||||
|
var redirectUrlParts = url.parse(redirectUrl);
|
||||||
|
Object.assign(this._options, redirectUrlParts);
|
||||||
|
|
||||||
|
// Drop confidential headers when redirecting to a less secure protocol
|
||||||
|
// or to a different domain that is not a superdomain
|
||||||
|
if (redirectUrlParts.protocol !== currentUrlParts.protocol &&
|
||||||
|
redirectUrlParts.protocol !== "https:" ||
|
||||||
|
redirectUrlParts.host !== currentHost &&
|
||||||
|
!isSubdomain(redirectUrlParts.host, currentHost)) {
|
||||||
|
removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Evaluate the beforeRedirect callback
|
||||||
|
if (typeof this._options.beforeRedirect === "function") {
|
||||||
|
var responseDetails = { headers: response.headers };
|
||||||
|
try {
|
||||||
|
this._options.beforeRedirect.call(null, this._options, responseDetails);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
this.emit("error", err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this._sanitizeOptions(this._options);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Perform the redirected request
|
||||||
|
try {
|
||||||
|
this._performRequest();
|
||||||
|
}
|
||||||
|
catch (cause) {
|
||||||
|
this.emit("error", new RedirectionError(cause));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5560,13 +5584,20 @@ function removeMatchingHeaders(regex, headers) {
|
|||||||
delete headers[header];
|
delete headers[header];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return lastValue;
|
return (lastValue === null || typeof lastValue === "undefined") ?
|
||||||
|
undefined : String(lastValue).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
function createErrorType(code, defaultMessage) {
|
function createErrorType(code, defaultMessage) {
|
||||||
function CustomError(message) {
|
function CustomError(cause) {
|
||||||
Error.captureStackTrace(this, this.constructor);
|
Error.captureStackTrace(this, this.constructor);
|
||||||
this.message = message || defaultMessage;
|
if (!cause) {
|
||||||
|
this.message = defaultMessage;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.message = defaultMessage + ": " + cause.message;
|
||||||
|
this.cause = cause;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CustomError.prototype = new Error();
|
CustomError.prototype = new Error();
|
||||||
CustomError.prototype.constructor = CustomError;
|
CustomError.prototype.constructor = CustomError;
|
||||||
@@ -5583,6 +5614,11 @@ function abortRequest(request) {
|
|||||||
request.abort();
|
request.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isSubdomain(subdomain, domain) {
|
||||||
|
const dot = subdomain.length - domain.length - 1;
|
||||||
|
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
|
||||||
|
}
|
||||||
|
|
||||||
// Exports
|
// Exports
|
||||||
module.exports = wrap({ http: http, https: https });
|
module.exports = wrap({ http: http, https: https });
|
||||||
module.exports.wrap = wrap;
|
module.exports.wrap = wrap;
|
||||||
@@ -7125,9 +7161,9 @@ class Deployment {
|
|||||||
this.deploymentInfo["status_url"] :
|
this.deploymentInfo["status_url"] :
|
||||||
`https://api.github.com/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
|
`https://api.github.com/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
|
||||||
core.setOutput('page_url', this.deploymentInfo != null ? this.deploymentInfo["page_url"] : "")
|
core.setOutput('page_url', this.deploymentInfo != null ? this.deploymentInfo["page_url"] : "")
|
||||||
const timeout = core.getInput('timeout')
|
const timeout = Number(core.getInput('timeout'))
|
||||||
const reportingInterval = Number(core.getInput('reporting_interval'))
|
const reportingInterval = Number(core.getInput('reporting_interval'))
|
||||||
const maxErrorCount = core.getInput('error_count')
|
const maxErrorCount = Number(core.getInput('error_count'))
|
||||||
var startTime = Date.now()
|
var startTime = Date.now()
|
||||||
var errorCount = 0
|
var errorCount = 0
|
||||||
|
|
||||||
@@ -7182,12 +7218,13 @@ class Deployment {
|
|||||||
core.setFailed('Failed with status code: ' + res.status)
|
core.setFailed('Failed with status code: ' + res.status)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Handle timeout
|
// Handle timeout
|
||||||
if (Date.now() - startTime >= timeout) {
|
if (Date.now() - startTime >= timeout) {
|
||||||
core.info('Timeout reached, aborting!')
|
core.info('Timeout reached, aborting!')
|
||||||
core.setFailed('Timeout reached, aborting!')
|
core.setFailed('Timeout reached, aborting!')
|
||||||
return
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error)
|
core.setFailed(error)
|
||||||
@@ -7444,7 +7481,7 @@ async function cancelHandler(evtOrExitCodeOrError) {
|
|||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/vnd.github.v3+json',
|
Accept: 'application/vnd.github.v3+json',
|
||||||
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
|
Authorization: `Bearer ${deployment.githubToken}`,
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7472,7 +7509,12 @@ process.on('SIGINT', cancelHandler)
|
|||||||
process.on('SIGTERM', cancelHandler)
|
process.on('SIGTERM', cancelHandler)
|
||||||
|
|
||||||
// Main
|
// Main
|
||||||
main().then(() => __nccwpck_require__(9557))
|
const emitTelemetry = core.getInput("emit_telemetry")
|
||||||
|
if (emitTelemetry === "true") {
|
||||||
|
__nccwpck_require__(9557)
|
||||||
|
} else {
|
||||||
|
main()
|
||||||
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
45
package-lock.json
generated
45
package-lock.json
generated
@@ -4211,9 +4211,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/follow-redirects": {
|
"node_modules/follow-redirects": {
|
||||||
"version": "1.14.4",
|
"version": "1.14.9",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz",
|
||||||
"integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==",
|
"integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "individual",
|
"type": "individual",
|
||||||
@@ -5975,9 +5975,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/minimist": {
|
"node_modules/minimist": {
|
||||||
"version": "1.2.5",
|
"version": "1.2.6",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
|
||||||
},
|
},
|
||||||
"node_modules/minipass": {
|
"node_modules/minipass": {
|
||||||
"version": "3.1.5",
|
"version": "3.1.5",
|
||||||
@@ -7123,6 +7123,20 @@
|
|||||||
"is-typedarray": "^1.0.0"
|
"is-typedarray": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/typescript": {
|
||||||
|
"version": "4.7.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz",
|
||||||
|
"integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==",
|
||||||
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
|
"bin": {
|
||||||
|
"tsc": "bin/tsc",
|
||||||
|
"tsserver": "bin/tsserver"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/unbox-primitive": {
|
"node_modules/unbox-primitive": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
|
||||||
@@ -10546,9 +10560,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"follow-redirects": {
|
"follow-redirects": {
|
||||||
"version": "1.14.4",
|
"version": "1.14.9",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz",
|
||||||
"integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g=="
|
"integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w=="
|
||||||
},
|
},
|
||||||
"form-data": {
|
"form-data": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
@@ -11859,9 +11873,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "1.2.5",
|
"version": "1.2.6",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
||||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
|
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q=="
|
||||||
},
|
},
|
||||||
"minipass": {
|
"minipass": {
|
||||||
"version": "3.1.5",
|
"version": "3.1.5",
|
||||||
@@ -12709,6 +12723,13 @@
|
|||||||
"is-typedarray": "^1.0.0"
|
"is-typedarray": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"typescript": {
|
||||||
|
"version": "4.7.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz",
|
||||||
|
"integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==",
|
||||||
|
"dev": true,
|
||||||
|
"peer": true
|
||||||
|
},
|
||||||
"unbox-primitive": {
|
"unbox-primitive": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
|
||||||
|
|||||||
207
pre/index.js
207
pre/index.js
@@ -5068,7 +5068,7 @@ events.forEach(function (event) {
|
|||||||
// Error types with codes
|
// Error types with codes
|
||||||
var RedirectionError = createErrorType(
|
var RedirectionError = createErrorType(
|
||||||
"ERR_FR_REDIRECTION_FAILURE",
|
"ERR_FR_REDIRECTION_FAILURE",
|
||||||
""
|
"Redirected request failed"
|
||||||
);
|
);
|
||||||
var TooManyRedirectsError = createErrorType(
|
var TooManyRedirectsError = createErrorType(
|
||||||
"ERR_FR_TOO_MANY_REDIRECTS",
|
"ERR_FR_TOO_MANY_REDIRECTS",
|
||||||
@@ -5219,10 +5219,16 @@ RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
|
|||||||
|
|
||||||
// Stops a timeout from triggering
|
// Stops a timeout from triggering
|
||||||
function clearTimer() {
|
function clearTimer() {
|
||||||
|
// Clear the timeout
|
||||||
if (self._timeout) {
|
if (self._timeout) {
|
||||||
clearTimeout(self._timeout);
|
clearTimeout(self._timeout);
|
||||||
self._timeout = null;
|
self._timeout = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clean up all attached listeners
|
||||||
|
self.removeListener("abort", clearTimer);
|
||||||
|
self.removeListener("error", clearTimer);
|
||||||
|
self.removeListener("response", clearTimer);
|
||||||
if (callback) {
|
if (callback) {
|
||||||
self.removeListener("timeout", callback);
|
self.removeListener("timeout", callback);
|
||||||
}
|
}
|
||||||
@@ -5246,8 +5252,9 @@ RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
|
|||||||
|
|
||||||
// Clean up on events
|
// Clean up on events
|
||||||
this.on("socket", destroyOnTimeout);
|
this.on("socket", destroyOnTimeout);
|
||||||
this.once("response", clearTimer);
|
this.on("abort", clearTimer);
|
||||||
this.once("error", clearTimer);
|
this.on("error", clearTimer);
|
||||||
|
this.on("response", clearTimer);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
@@ -5379,84 +5386,101 @@ RedirectableRequest.prototype._processResponse = function (response) {
|
|||||||
// the user agent MAY automatically redirect its request to the URI
|
// the user agent MAY automatically redirect its request to the URI
|
||||||
// referenced by the Location field value,
|
// referenced by the Location field value,
|
||||||
// even if the specific status code is not understood.
|
// even if the specific status code is not understood.
|
||||||
|
|
||||||
|
// If the response is not a redirect; return it as-is
|
||||||
var location = response.headers.location;
|
var location = response.headers.location;
|
||||||
if (location && this._options.followRedirects !== false &&
|
if (!location || this._options.followRedirects === false ||
|
||||||
statusCode >= 300 && statusCode < 400) {
|
statusCode < 300 || statusCode >= 400) {
|
||||||
// Abort the current request
|
|
||||||
abortRequest(this._currentRequest);
|
|
||||||
// Discard the remainder of the response to avoid waiting for data
|
|
||||||
response.destroy();
|
|
||||||
|
|
||||||
// RFC7231§6.4: A client SHOULD detect and intervene
|
|
||||||
// in cyclical redirections (i.e., "infinite" redirection loops).
|
|
||||||
if (++this._redirectCount > this._options.maxRedirects) {
|
|
||||||
this.emit("error", new TooManyRedirectsError());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// RFC7231§6.4: Automatic redirection needs to done with
|
|
||||||
// care for methods not known to be safe, […]
|
|
||||||
// RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
|
|
||||||
// the request method from POST to GET for the subsequent request.
|
|
||||||
if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
|
|
||||||
// RFC7231§6.4.4: The 303 (See Other) status code indicates that
|
|
||||||
// the server is redirecting the user agent to a different resource […]
|
|
||||||
// A user agent can perform a retrieval request targeting that URI
|
|
||||||
// (a GET or HEAD request if using HTTP) […]
|
|
||||||
(statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
|
|
||||||
this._options.method = "GET";
|
|
||||||
// Drop a possible entity and headers related to it
|
|
||||||
this._requestBodyBuffers = [];
|
|
||||||
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Drop the Host header, as the redirect might lead to a different host
|
|
||||||
var previousHostName = removeMatchingHeaders(/^host$/i, this._options.headers) ||
|
|
||||||
url.parse(this._currentUrl).hostname;
|
|
||||||
|
|
||||||
// Create the redirected request
|
|
||||||
var redirectUrl = url.resolve(this._currentUrl, location);
|
|
||||||
debug("redirecting to", redirectUrl);
|
|
||||||
this._isRedirect = true;
|
|
||||||
var redirectUrlParts = url.parse(redirectUrl);
|
|
||||||
Object.assign(this._options, redirectUrlParts);
|
|
||||||
|
|
||||||
// Drop the Authorization header if redirecting to another host
|
|
||||||
if (redirectUrlParts.hostname !== previousHostName) {
|
|
||||||
removeMatchingHeaders(/^authorization$/i, this._options.headers);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Evaluate the beforeRedirect callback
|
|
||||||
if (typeof this._options.beforeRedirect === "function") {
|
|
||||||
var responseDetails = { headers: response.headers };
|
|
||||||
try {
|
|
||||||
this._options.beforeRedirect.call(null, this._options, responseDetails);
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
this.emit("error", err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._sanitizeOptions(this._options);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Perform the redirected request
|
|
||||||
try {
|
|
||||||
this._performRequest();
|
|
||||||
}
|
|
||||||
catch (cause) {
|
|
||||||
var error = new RedirectionError("Redirected request failed: " + cause.message);
|
|
||||||
error.cause = cause;
|
|
||||||
this.emit("error", error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// The response is not a redirect; return it as-is
|
|
||||||
response.responseUrl = this._currentUrl;
|
response.responseUrl = this._currentUrl;
|
||||||
response.redirects = this._redirects;
|
response.redirects = this._redirects;
|
||||||
this.emit("response", response);
|
this.emit("response", response);
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
this._requestBodyBuffers = [];
|
this._requestBodyBuffers = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The response is a redirect, so abort the current request
|
||||||
|
abortRequest(this._currentRequest);
|
||||||
|
// Discard the remainder of the response to avoid waiting for data
|
||||||
|
response.destroy();
|
||||||
|
|
||||||
|
// RFC7231§6.4: A client SHOULD detect and intervene
|
||||||
|
// in cyclical redirections (i.e., "infinite" redirection loops).
|
||||||
|
if (++this._redirectCount > this._options.maxRedirects) {
|
||||||
|
this.emit("error", new TooManyRedirectsError());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// RFC7231§6.4: Automatic redirection needs to done with
|
||||||
|
// care for methods not known to be safe, […]
|
||||||
|
// RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
|
||||||
|
// the request method from POST to GET for the subsequent request.
|
||||||
|
if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
|
||||||
|
// RFC7231§6.4.4: The 303 (See Other) status code indicates that
|
||||||
|
// the server is redirecting the user agent to a different resource […]
|
||||||
|
// A user agent can perform a retrieval request targeting that URI
|
||||||
|
// (a GET or HEAD request if using HTTP) […]
|
||||||
|
(statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
|
||||||
|
this._options.method = "GET";
|
||||||
|
// Drop a possible entity and headers related to it
|
||||||
|
this._requestBodyBuffers = [];
|
||||||
|
removeMatchingHeaders(/^content-/i, this._options.headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Drop the Host header, as the redirect might lead to a different host
|
||||||
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
||||||
|
|
||||||
|
// If the redirect is relative, carry over the host of the last request
|
||||||
|
var currentUrlParts = url.parse(this._currentUrl);
|
||||||
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
||||||
|
var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
|
||||||
|
url.format(Object.assign(currentUrlParts, { host: currentHost }));
|
||||||
|
|
||||||
|
// Determine the URL of the redirection
|
||||||
|
var redirectUrl;
|
||||||
|
try {
|
||||||
|
redirectUrl = url.resolve(currentUrl, location);
|
||||||
|
}
|
||||||
|
catch (cause) {
|
||||||
|
this.emit("error", new RedirectionError(cause));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the redirected request
|
||||||
|
debug("redirecting to", redirectUrl);
|
||||||
|
this._isRedirect = true;
|
||||||
|
var redirectUrlParts = url.parse(redirectUrl);
|
||||||
|
Object.assign(this._options, redirectUrlParts);
|
||||||
|
|
||||||
|
// Drop confidential headers when redirecting to a less secure protocol
|
||||||
|
// or to a different domain that is not a superdomain
|
||||||
|
if (redirectUrlParts.protocol !== currentUrlParts.protocol &&
|
||||||
|
redirectUrlParts.protocol !== "https:" ||
|
||||||
|
redirectUrlParts.host !== currentHost &&
|
||||||
|
!isSubdomain(redirectUrlParts.host, currentHost)) {
|
||||||
|
removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Evaluate the beforeRedirect callback
|
||||||
|
if (typeof this._options.beforeRedirect === "function") {
|
||||||
|
var responseDetails = { headers: response.headers };
|
||||||
|
try {
|
||||||
|
this._options.beforeRedirect.call(null, this._options, responseDetails);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
this.emit("error", err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this._sanitizeOptions(this._options);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Perform the redirected request
|
||||||
|
try {
|
||||||
|
this._performRequest();
|
||||||
|
}
|
||||||
|
catch (cause) {
|
||||||
|
this.emit("error", new RedirectionError(cause));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5560,13 +5584,20 @@ function removeMatchingHeaders(regex, headers) {
|
|||||||
delete headers[header];
|
delete headers[header];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return lastValue;
|
return (lastValue === null || typeof lastValue === "undefined") ?
|
||||||
|
undefined : String(lastValue).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
function createErrorType(code, defaultMessage) {
|
function createErrorType(code, defaultMessage) {
|
||||||
function CustomError(message) {
|
function CustomError(cause) {
|
||||||
Error.captureStackTrace(this, this.constructor);
|
Error.captureStackTrace(this, this.constructor);
|
||||||
this.message = message || defaultMessage;
|
if (!cause) {
|
||||||
|
this.message = defaultMessage;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.message = defaultMessage + ": " + cause.message;
|
||||||
|
this.cause = cause;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CustomError.prototype = new Error();
|
CustomError.prototype = new Error();
|
||||||
CustomError.prototype.constructor = CustomError;
|
CustomError.prototype.constructor = CustomError;
|
||||||
@@ -5583,6 +5614,11 @@ function abortRequest(request) {
|
|||||||
request.abort();
|
request.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isSubdomain(subdomain, domain) {
|
||||||
|
const dot = subdomain.length - domain.length - 1;
|
||||||
|
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
|
||||||
|
}
|
||||||
|
|
||||||
// Exports
|
// Exports
|
||||||
module.exports = wrap({ http: http, https: https });
|
module.exports = wrap({ http: http, https: https });
|
||||||
module.exports.wrap = wrap;
|
module.exports.wrap = wrap;
|
||||||
@@ -7125,9 +7161,9 @@ class Deployment {
|
|||||||
this.deploymentInfo["status_url"] :
|
this.deploymentInfo["status_url"] :
|
||||||
`https://api.github.com/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
|
`https://api.github.com/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
|
||||||
core.setOutput('page_url', this.deploymentInfo != null ? this.deploymentInfo["page_url"] : "")
|
core.setOutput('page_url', this.deploymentInfo != null ? this.deploymentInfo["page_url"] : "")
|
||||||
const timeout = core.getInput('timeout')
|
const timeout = Number(core.getInput('timeout'))
|
||||||
const reportingInterval = Number(core.getInput('reporting_interval'))
|
const reportingInterval = Number(core.getInput('reporting_interval'))
|
||||||
const maxErrorCount = core.getInput('error_count')
|
const maxErrorCount = Number(core.getInput('error_count'))
|
||||||
var startTime = Date.now()
|
var startTime = Date.now()
|
||||||
var errorCount = 0
|
var errorCount = 0
|
||||||
|
|
||||||
@@ -7182,12 +7218,13 @@ class Deployment {
|
|||||||
core.setFailed('Failed with status code: ' + res.status)
|
core.setFailed('Failed with status code: ' + res.status)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Handle timeout
|
// Handle timeout
|
||||||
if (Date.now() - startTime >= timeout) {
|
if (Date.now() - startTime >= timeout) {
|
||||||
core.info('Timeout reached, aborting!')
|
core.info('Timeout reached, aborting!')
|
||||||
core.setFailed('Timeout reached, aborting!')
|
core.setFailed('Timeout reached, aborting!')
|
||||||
return
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error)
|
core.setFailed(error)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -81,9 +81,9 @@ class Deployment {
|
|||||||
this.deploymentInfo["status_url"] :
|
this.deploymentInfo["status_url"] :
|
||||||
`https://api.github.com/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
|
`https://api.github.com/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
|
||||||
core.setOutput('page_url', this.deploymentInfo != null ? this.deploymentInfo["page_url"] : "")
|
core.setOutput('page_url', this.deploymentInfo != null ? this.deploymentInfo["page_url"] : "")
|
||||||
const timeout = core.getInput('timeout')
|
const timeout = Number(core.getInput('timeout'))
|
||||||
const reportingInterval = Number(core.getInput('reporting_interval'))
|
const reportingInterval = Number(core.getInput('reporting_interval'))
|
||||||
const maxErrorCount = core.getInput('error_count')
|
const maxErrorCount = Number(core.getInput('error_count'))
|
||||||
var startTime = Date.now()
|
var startTime = Date.now()
|
||||||
var errorCount = 0
|
var errorCount = 0
|
||||||
|
|
||||||
@@ -138,12 +138,13 @@ class Deployment {
|
|||||||
core.setFailed('Failed with status code: ' + res.status)
|
core.setFailed('Failed with status code: ' + res.status)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Handle timeout
|
// Handle timeout
|
||||||
if (Date.now() - startTime >= timeout) {
|
if (Date.now() - startTime >= timeout) {
|
||||||
core.info('Timeout reached, aborting!')
|
core.info('Timeout reached, aborting!')
|
||||||
core.setFailed('Timeout reached, aborting!')
|
core.setFailed('Timeout reached, aborting!')
|
||||||
return
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error)
|
core.setFailed(error)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ async function cancelHandler(evtOrExitCodeOrError) {
|
|||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/vnd.github.v3+json',
|
Accept: 'application/vnd.github.v3+json',
|
||||||
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
|
Authorization: `Bearer ${deployment.githubToken}`,
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,4 +52,9 @@ process.on('SIGINT', cancelHandler)
|
|||||||
process.on('SIGTERM', cancelHandler)
|
process.on('SIGTERM', cancelHandler)
|
||||||
|
|
||||||
// Main
|
// Main
|
||||||
main().then(() => require('./pre'))
|
const emitTelemetry = core.getInput("emit_telemetry")
|
||||||
|
if (emitTelemetry === "true") {
|
||||||
|
require('./pre')
|
||||||
|
} else {
|
||||||
|
main()
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user