fix(deps): update dependency @actions/core to v2
All checks were successful
Lint / pre-commit Linting (push) Successful in 1m43s

This commit is contained in:
2025-12-21 11:57:51 +00:00
parent 76eaa21fb3
commit 09e414ad88
94 changed files with 2193 additions and 2984 deletions

17
node_modules/.bin/glob.cmd generated vendored
View File

@@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\glob\dist\esm\bin.mjs" %*

28
node_modules/.bin/glob.ps1 generated vendored
View File

@@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../glob/dist/esm/bin.mjs" $args
} else {
& "$basedir/node$exe" "$basedir/../glob/dist/esm/bin.mjs" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../glob/dist/esm/bin.mjs" $args
} else {
& "node$exe" "$basedir/../glob/dist/esm/bin.mjs" $args
}
$ret=$LASTEXITCODE
}
exit $ret

17
node_modules/.bin/json2yaml.cmd generated vendored
View File

@@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\yamljs\bin\json2yaml" %*

28
node_modules/.bin/json2yaml.ps1 generated vendored
View File

@@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../yamljs/bin/json2yaml" $args
} else {
& "$basedir/node$exe" "$basedir/../yamljs/bin/json2yaml" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../yamljs/bin/json2yaml" $args
} else {
& "node$exe" "$basedir/../yamljs/bin/json2yaml" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View File

@@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\node-gyp-build\optional.js" %*

View File

@@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../node-gyp-build/optional.js" $args
} else {
& "$basedir/node$exe" "$basedir/../node-gyp-build/optional.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../node-gyp-build/optional.js" $args
} else {
& "node$exe" "$basedir/../node-gyp-build/optional.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

View File

@@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\node-gyp-build\build-test.js" %*

View File

@@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../node-gyp-build/build-test.js" $args
} else {
& "$basedir/node$exe" "$basedir/../node-gyp-build/build-test.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../node-gyp-build/build-test.js" $args
} else {
& "node$exe" "$basedir/../node-gyp-build/build-test.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

17
node_modules/.bin/node-gyp-build.cmd generated vendored
View File

@@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\node-gyp-build\bin.js" %*

28
node_modules/.bin/node-gyp-build.ps1 generated vendored
View File

@@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../node-gyp-build/bin.js" $args
} else {
& "$basedir/node$exe" "$basedir/../node-gyp-build/bin.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../node-gyp-build/bin.js" $args
} else {
& "node$exe" "$basedir/../node-gyp-build/bin.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

17
node_modules/.bin/node-which.cmd generated vendored
View File

@@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\which\bin\node-which" %*

28
node_modules/.bin/node-which.ps1 generated vendored
View File

@@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args
} else {
& "$basedir/node$exe" "$basedir/../which/bin/node-which" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../which/bin/node-which" $args
} else {
& "node$exe" "$basedir/../which/bin/node-which" $args
}
$ret=$LASTEXITCODE
}
exit $ret

17
node_modules/.bin/screeps-api.cmd generated vendored
View File

@@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\screeps-api\bin\screeps-api.js" %*

28
node_modules/.bin/screeps-api.ps1 generated vendored
View File

@@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../screeps-api/bin/screeps-api.js" $args
} else {
& "$basedir/node$exe" "$basedir/../screeps-api/bin/screeps-api.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../screeps-api/bin/screeps-api.js" $args
} else {
& "node$exe" "$basedir/../screeps-api/bin/screeps-api.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

17
node_modules/.bin/yaml2json.cmd generated vendored
View File

@@ -1,17 +0,0 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\yamljs\bin\yaml2json" %*

28
node_modules/.bin/yaml2json.ps1 generated vendored
View File

@@ -1,28 +0,0 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../yamljs/bin/yaml2json" $args
} else {
& "$basedir/node$exe" "$basedir/../yamljs/bin/yaml2json" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../yamljs/bin/yaml2json" $args
} else {
& "node$exe" "$basedir/../yamljs/bin/yaml2json" $args
}
$ret=$LASTEXITCODE
}
exit $ret

64
node_modules/.package-lock.json generated vendored
View File

@@ -5,35 +5,39 @@
"requires": true, "requires": true,
"packages": { "packages": {
"node_modules/@actions/core": { "node_modules/@actions/core": {
"version": "1.11.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", "resolved": "https://registry.npmjs.org/@actions/core/-/core-2.0.1.tgz",
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", "integrity": "sha512-oBfqT3GwkvLlo1fjvhQLQxuwZCGTarTE5OuZ2Wg10hvhBj7LRIlF611WT4aZS6fDhO5ZKlY7lCAZTlpmyaHaeg==",
"license": "MIT",
"dependencies": { "dependencies": {
"@actions/exec": "^1.1.1", "@actions/exec": "^2.0.0",
"@actions/http-client": "^2.0.1" "@actions/http-client": "^3.0.0"
} }
}, },
"node_modules/@actions/exec": { "node_modules/@actions/exec": {
"version": "1.1.1", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-2.0.0.tgz",
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", "integrity": "sha512-k8ngrX2voJ/RIN6r9xB82NVqKpnMRtxDoiO+g3olkIUpQNqjArXrCQceduQZCQj3P3xm32pChRLqRrtXTlqhIw==",
"license": "MIT",
"dependencies": { "dependencies": {
"@actions/io": "^1.0.1" "@actions/io": "^2.0.0"
} }
}, },
"node_modules/@actions/http-client": { "node_modules/@actions/http-client": {
"version": "2.2.3", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-3.0.0.tgz",
"integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", "integrity": "sha512-1s3tXAfVMSz9a4ZEBkXXRQD4QhY3+GAsWSbaYpeknPOKEeyRiU3lH+bHiLMZdo2x/fIeQ/hscL1wCkDLVM2DZQ==",
"license": "MIT",
"dependencies": { "dependencies": {
"tunnel": "^0.0.6", "tunnel": "^0.0.6",
"undici": "^5.25.4" "undici": "^5.28.5"
} }
}, },
"node_modules/@actions/io": { "node_modules/@actions/io": {
"version": "1.1.3", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", "resolved": "https://registry.npmjs.org/@actions/io/-/io-2.0.0.tgz",
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==" "integrity": "sha512-Jv33IN09XLO+0HS79aaODsvIRyduiF7NY/F6LYeK5oeUmrsz7aFdRphQjFoESF4jS7lMauDOttKALcpapVDIAg==",
"license": "MIT"
}, },
"node_modules/@fastify/busboy": { "node_modules/@fastify/busboy": {
"version": "2.1.1", "version": "2.1.1",
@@ -132,20 +136,6 @@
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
}, },
"node_modules/bufferutil": {
"version": "4.0.9",
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.9.tgz",
"integrity": "sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw==",
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"dependencies": {
"node-gyp-build": "^4.3.0"
},
"engines": {
"node": ">=6.14.2"
}
},
"node_modules/call-bind-apply-helpers": { "node_modules/call-bind-apply-helpers": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
@@ -819,20 +809,6 @@
"node": ">=14.0" "node": ">=14.0"
} }
}, },
"node_modules/utf-8-validate": {
"version": "5.0.10",
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz",
"integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==",
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"dependencies": {
"node-gyp-build": "^4.3.0"
},
"engines": {
"node": ">=6.14.2"
}
},
"node_modules/which": { "node_modules/which": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",

View File

@@ -16,7 +16,7 @@ import * as core from '@actions/core';
#### Inputs/Outputs #### Inputs/Outputs
Action inputs can be read with `getInput` which returns a `string` or `getBooleanInput` which parses a boolean based on the [yaml 1.2 specification](https://yaml.org/spec/1.2/spec.html#id2804923). If `required` set to be false, the input should have a default value in `action.yml`. Action inputs can be read with `getInput` which returns a `string` or `getBooleanInput` which parses a boolean based on the [yaml 1.2 specification](https://yaml.org/spec/1.2/spec.html#id2804923). If `required` is set to be false, the input should have a default value in `action.yml`.
Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled. Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled.

View File

@@ -2,14 +2,37 @@ export interface CommandProperties {
[key: string]: any; [key: string]: any;
} }
/** /**
* Commands * Issues a command to the GitHub Actions runner
*
* @param command - The command name to issue
* @param properties - Additional properties for the command (key-value pairs)
* @param message - The message to include with the command
* @remarks
* This function outputs a specially formatted string to stdout that the Actions
* runner interprets as a command. These commands can control workflow behavior,
* set outputs, create annotations, mask values, and more.
* *
* Command Format: * Command Format:
* ::name key=value,key=value::message * ::name key=value,key=value::message
* *
* Examples: * @example
* ::warning::This is the message * ```typescript
* ::set-env name=MY_VAR::some value * // Issue a warning annotation
* issueCommand('warning', {}, 'This is a warning message');
* // Output: ::warning::This is a warning message
*
* // Set an environment variable
* issueCommand('set-env', { name: 'MY_VAR' }, 'some value');
* // Output: ::set-env name=MY_VAR::some value
*
* // Add a secret mask
* issueCommand('add-mask', {}, 'secretValue123');
* // Output: ::add-mask::secretValue123
* ```
*
* @internal
* This is an internal utility function that powers the public API functions
* such as setSecret, warning, error, and exportVariable.
*/ */
export declare function issueCommand(command: string, properties: CommandProperties, message: any): void; export declare function issueCommand(command: string, properties: CommandProperties, message: any): void;
export declare function issue(name: string, message?: string): void; export declare function issue(name: string, message?: string): void;

View File

@@ -15,36 +15,68 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || (function () {
if (mod && mod.__esModule) return mod; var ownKeys = function(o) {
var result = {}; ownKeys = Object.getOwnPropertyNames || function (o) {
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); var ar = [];
__setModuleDefault(result, mod); for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return result; return ar;
}; };
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.issue = exports.issueCommand = void 0; exports.issueCommand = issueCommand;
exports.issue = issue;
const os = __importStar(require("os")); const os = __importStar(require("os"));
const utils_1 = require("./utils"); const utils_1 = require("./utils");
/** /**
* Commands * Issues a command to the GitHub Actions runner
*
* @param command - The command name to issue
* @param properties - Additional properties for the command (key-value pairs)
* @param message - The message to include with the command
* @remarks
* This function outputs a specially formatted string to stdout that the Actions
* runner interprets as a command. These commands can control workflow behavior,
* set outputs, create annotations, mask values, and more.
* *
* Command Format: * Command Format:
* ::name key=value,key=value::message * ::name key=value,key=value::message
* *
* Examples: * @example
* ::warning::This is the message * ```typescript
* ::set-env name=MY_VAR::some value * // Issue a warning annotation
* issueCommand('warning', {}, 'This is a warning message');
* // Output: ::warning::This is a warning message
*
* // Set an environment variable
* issueCommand('set-env', { name: 'MY_VAR' }, 'some value');
* // Output: ::set-env name=MY_VAR::some value
*
* // Add a secret mask
* issueCommand('add-mask', {}, 'secretValue123');
* // Output: ::add-mask::secretValue123
* ```
*
* @internal
* This is an internal utility function that powers the public API functions
* such as setSecret, warning, error, and exportVariable.
*/ */
function issueCommand(command, properties, message) { function issueCommand(command, properties, message) {
const cmd = new Command(command, properties, message); const cmd = new Command(command, properties, message);
process.stdout.write(cmd.toString() + os.EOL); process.stdout.write(cmd.toString() + os.EOL);
} }
exports.issueCommand = issueCommand;
function issue(name, message = '') { function issue(name, message = '') {
issueCommand(name, {}, message); issueCommand(name, {}, message);
} }
exports.issue = issue;
const CMD_STRING = '::'; const CMD_STRING = '::';
class Command { class Command {
constructor(command, properties, message) { constructor(command, properties, message) {

View File

@@ -1 +1 @@
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,mCAAsC;AAWtC;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAY;IAEZ,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,OAAO,GAAG,EAAE;IAC9C,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAA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KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}

View File

@@ -59,7 +59,32 @@ export interface AnnotationProperties {
export declare function exportVariable(name: string, val: any): void; export declare function exportVariable(name: string, val: any): void;
/** /**
* Registers a secret which will get masked from logs * Registers a secret which will get masked from logs
* @param secret value of the secret *
* @param secret - Value of the secret to be masked
* @remarks
* This function instructs the Actions runner to mask the specified value in any
* logs produced during the workflow run. Once registered, the secret value will
* be replaced with asterisks (***) whenever it appears in console output, logs,
* or error messages.
*
* This is useful for protecting sensitive information such as:
* - API keys
* - Access tokens
* - Authentication credentials
* - URL parameters containing signatures (SAS tokens)
*
* Note that masking only affects future logs; any previous appearances of the
* secret in logs before calling this function will remain unmasked.
*
* @example
* ```typescript
* // Register an API token as a secret
* const apiToken = "abc123xyz456";
* setSecret(apiToken);
*
* // Now any logs containing this value will show *** instead
* console.log(`Using token: ${apiToken}`); // Outputs: "Using token: ***"
* ```
*/ */
export declare function setSecret(secret: string): void; export declare function setSecret(secret: string): void;
/** /**

View File

@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || (function () {
if (mod && mod.__esModule) return mod; var ownKeys = function(o) {
var result = {}; ownKeys = Object.getOwnPropertyNames || function (o) {
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); var ar = [];
__setModuleDefault(result, mod); for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return result; return ar;
}; };
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
@@ -32,7 +42,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}); });
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.ExitCode = void 0;
exports.exportVariable = exportVariable;
exports.setSecret = setSecret;
exports.addPath = addPath;
exports.getInput = getInput;
exports.getMultilineInput = getMultilineInput;
exports.getBooleanInput = getBooleanInput;
exports.setOutput = setOutput;
exports.setCommandEcho = setCommandEcho;
exports.setFailed = setFailed;
exports.isDebug = isDebug;
exports.debug = debug;
exports.error = error;
exports.warning = warning;
exports.notice = notice;
exports.info = info;
exports.startGroup = startGroup;
exports.endGroup = endGroup;
exports.group = group;
exports.saveState = saveState;
exports.getState = getState;
exports.getIDToken = getIDToken;
const command_1 = require("./command"); const command_1 = require("./command");
const file_command_1 = require("./file-command"); const file_command_1 = require("./file-command");
const utils_1 = require("./utils"); const utils_1 = require("./utils");
@@ -71,15 +102,38 @@ function exportVariable(name, val) {
} }
(0, command_1.issueCommand)('set-env', { name }, convertedVal); (0, command_1.issueCommand)('set-env', { name }, convertedVal);
} }
exports.exportVariable = exportVariable;
/** /**
* Registers a secret which will get masked from logs * Registers a secret which will get masked from logs
* @param secret value of the secret *
* @param secret - Value of the secret to be masked
* @remarks
* This function instructs the Actions runner to mask the specified value in any
* logs produced during the workflow run. Once registered, the secret value will
* be replaced with asterisks (***) whenever it appears in console output, logs,
* or error messages.
*
* This is useful for protecting sensitive information such as:
* - API keys
* - Access tokens
* - Authentication credentials
* - URL parameters containing signatures (SAS tokens)
*
* Note that masking only affects future logs; any previous appearances of the
* secret in logs before calling this function will remain unmasked.
*
* @example
* ```typescript
* // Register an API token as a secret
* const apiToken = "abc123xyz456";
* setSecret(apiToken);
*
* // Now any logs containing this value will show *** instead
* console.log(`Using token: ${apiToken}`); // Outputs: "Using token: ***"
* ```
*/ */
function setSecret(secret) { function setSecret(secret) {
(0, command_1.issueCommand)('add-mask', {}, secret); (0, command_1.issueCommand)('add-mask', {}, secret);
} }
exports.setSecret = setSecret;
/** /**
* Prepends inputPath to the PATH (for this action and future actions) * Prepends inputPath to the PATH (for this action and future actions)
* @param inputPath * @param inputPath
@@ -94,7 +148,6 @@ function addPath(inputPath) {
} }
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
} }
exports.addPath = addPath;
/** /**
* Gets the value of an input. * Gets the value of an input.
* Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
@@ -114,7 +167,6 @@ function getInput(name, options) {
} }
return val.trim(); return val.trim();
} }
exports.getInput = getInput;
/** /**
* Gets the values of an multiline input. Each value is also trimmed. * Gets the values of an multiline input. Each value is also trimmed.
* *
@@ -132,7 +184,6 @@ function getMultilineInput(name, options) {
} }
return inputs.map(input => input.trim()); return inputs.map(input => input.trim());
} }
exports.getMultilineInput = getMultilineInput;
/** /**
* Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
* Support boolean input list: `true | True | TRUE | false | False | FALSE` . * Support boolean input list: `true | True | TRUE | false | False | FALSE` .
@@ -154,7 +205,6 @@ function getBooleanInput(name, options) {
throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
} }
exports.getBooleanInput = getBooleanInput;
/** /**
* Sets the value of an output. * Sets the value of an output.
* *
@@ -170,7 +220,6 @@ function setOutput(name, value) {
process.stdout.write(os.EOL); process.stdout.write(os.EOL);
(0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value)); (0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value));
} }
exports.setOutput = setOutput;
/** /**
* Enables or disables the echoing of commands into stdout for the rest of the step. * Enables or disables the echoing of commands into stdout for the rest of the step.
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
@@ -179,7 +228,6 @@ exports.setOutput = setOutput;
function setCommandEcho(enabled) { function setCommandEcho(enabled) {
(0, command_1.issue)('echo', enabled ? 'on' : 'off'); (0, command_1.issue)('echo', enabled ? 'on' : 'off');
} }
exports.setCommandEcho = setCommandEcho;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// Results // Results
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
@@ -192,7 +240,6 @@ function setFailed(message) {
process.exitCode = ExitCode.Failure; process.exitCode = ExitCode.Failure;
error(message); error(message);
} }
exports.setFailed = setFailed;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// Logging Commands // Logging Commands
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
@@ -202,7 +249,6 @@ exports.setFailed = setFailed;
function isDebug() { function isDebug() {
return process.env['RUNNER_DEBUG'] === '1'; return process.env['RUNNER_DEBUG'] === '1';
} }
exports.isDebug = isDebug;
/** /**
* Writes debug message to user log * Writes debug message to user log
* @param message debug message * @param message debug message
@@ -210,7 +256,6 @@ exports.isDebug = isDebug;
function debug(message) { function debug(message) {
(0, command_1.issueCommand)('debug', {}, message); (0, command_1.issueCommand)('debug', {}, message);
} }
exports.debug = debug;
/** /**
* Adds an error issue * Adds an error issue
* @param message error issue message. Errors will be converted to string via toString() * @param message error issue message. Errors will be converted to string via toString()
@@ -219,7 +264,6 @@ exports.debug = debug;
function error(message, properties = {}) { function error(message, properties = {}) {
(0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); (0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
} }
exports.error = error;
/** /**
* Adds a warning issue * Adds a warning issue
* @param message warning issue message. Errors will be converted to string via toString() * @param message warning issue message. Errors will be converted to string via toString()
@@ -228,7 +272,6 @@ exports.error = error;
function warning(message, properties = {}) { function warning(message, properties = {}) {
(0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); (0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
} }
exports.warning = warning;
/** /**
* Adds a notice issue * Adds a notice issue
* @param message notice issue message. Errors will be converted to string via toString() * @param message notice issue message. Errors will be converted to string via toString()
@@ -237,7 +280,6 @@ exports.warning = warning;
function notice(message, properties = {}) { function notice(message, properties = {}) {
(0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); (0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
} }
exports.notice = notice;
/** /**
* Writes info to log with console.log. * Writes info to log with console.log.
* @param message info message * @param message info message
@@ -245,7 +287,6 @@ exports.notice = notice;
function info(message) { function info(message) {
process.stdout.write(message + os.EOL); process.stdout.write(message + os.EOL);
} }
exports.info = info;
/** /**
* Begin an output group. * Begin an output group.
* *
@@ -256,14 +297,12 @@ exports.info = info;
function startGroup(name) { function startGroup(name) {
(0, command_1.issue)('group', name); (0, command_1.issue)('group', name);
} }
exports.startGroup = startGroup;
/** /**
* End an output group. * End an output group.
*/ */
function endGroup() { function endGroup() {
(0, command_1.issue)('endgroup'); (0, command_1.issue)('endgroup');
} }
exports.endGroup = endGroup;
/** /**
* Wrap an asynchronous function call in a group. * Wrap an asynchronous function call in a group.
* *
@@ -285,7 +324,6 @@ function group(name, fn) {
return result; return result;
}); });
} }
exports.group = group;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// Wrapper action state // Wrapper action state
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
@@ -303,7 +341,6 @@ function saveState(name, value) {
} }
(0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value)); (0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value));
} }
exports.saveState = saveState;
/** /**
* Gets the value of an state set by this action's main execution. * Gets the value of an state set by this action's main execution.
* *
@@ -313,13 +350,11 @@ exports.saveState = saveState;
function getState(name) { function getState(name) {
return process.env[`STATE_${name}`] || ''; return process.env[`STATE_${name}`] || '';
} }
exports.getState = getState;
function getIDToken(aud) { function getIDToken(aud) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
return yield oidc_utils_1.OidcClient.getIDToken(aud); return yield oidc_utils_1.OidcClient.getIDToken(aud);
}); });
} }
exports.getIDToken = getIDToken;
/** /**
* Summary exports * Summary exports
*/ */

File diff suppressed because one or more lines are too long

View File

@@ -16,15 +16,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || (function () {
if (mod && mod.__esModule) return mod; var ownKeys = function(o) {
var result = {}; ownKeys = Object.getOwnPropertyNames || function (o) {
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); var ar = [];
__setModuleDefault(result, mod); for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return result; return ar;
}; };
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; exports.issueFileCommand = issueFileCommand;
exports.prepareKeyValueMessage = prepareKeyValueMessage;
// We use any as a valid input type // We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
const crypto = __importStar(require("crypto")); const crypto = __importStar(require("crypto"));
@@ -43,7 +54,6 @@ function issueFileCommand(command, message) {
encoding: 'utf8' encoding: 'utf8'
}); });
} }
exports.issueFileCommand = issueFileCommand;
function prepareKeyValueMessage(key, value) { function prepareKeyValueMessage(key, value) {
const delimiter = `ghadelimiter_${crypto.randomUUID()}`; const delimiter = `ghadelimiter_${crypto.randomUUID()}`;
const convertedValue = (0, utils_1.toCommandValue)(value); const convertedValue = (0, utils_1.toCommandValue)(value);
@@ -58,5 +68,4 @@ function prepareKeyValueMessage(key, value) {
} }
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
} }
exports.prepareKeyValueMessage = prepareKeyValueMessage;
//# sourceMappingURL=file-command.js.map //# sourceMappingURL=file-command.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"file-command.js","sourceRoot":"","sources":["../src/file-command.ts"],"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AAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CACb,6DAA6D,SAAS,GAAG,CAC1E,CAAA;IACH,CAAC;IAED,OAAO,GAAG,GAAG,KAAK,SAAS,GAAG,EAAE,CAAC,GAAG,GAAG,cAAc,GAAG,EAAE,CAAC,GAAG,GAAG,SAAS,EAAE,CAAA;AAC9E,CAAC"}

View File

@@ -36,8 +36,8 @@ class OidcClient {
return runtimeUrl; return runtimeUrl;
} }
static getCall(id_token_url) { static getCall(id_token_url) {
var _a;
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
var _a;
const httpclient = OidcClient.createHttpClient(); const httpclient = OidcClient.createHttpClient();
const res = yield httpclient const res = yield httpclient
.getJson(id_token_url) .getJson(id_token_url)

View File

@@ -1 +1 @@
{"version":3,"file":"oidc-utils.js","sourceRoot":"","sources":["../src/oidc-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,sDAA+C;AAC/C,wDAAqE;AACrE,iCAAuC;AAKvC,MAAa,UAAU;IACb,MAAM,CAAC,gBAAgB,CAC7B,UAAU,GAAG,IAAI,EACjB,QAAQ,GAAG,EAAE;QAEb,MAAM,cAAc,GAAmB;YACrC,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,QAAQ;SACrB,CAAA;QAED,OAAO,IAAI,wBAAU,CACnB,qBAAqB,EACrB,CAAC,IAAI,8BAAuB,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC,EAC3D,cAAc,CACf,CAAA;IACH,CAAC;IAEO,MAAM,CAAC,eAAe;QAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;QAC3D,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAI,KAAK,CACb,2DAA2D,CAC5D,CAAA;SACF;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAEO,MAAM,CAAC,aAAa;QAC1B,MAAM,UAAU,GAAG,OAAO,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AK,CAAC,OAAO,EAAE,CAC/B,CAAA;YACH,CAAC,CAAC,CAAA;YAEJ,MAAM,QAAQ,GAAG,MAAA,GAAG,CAAC,MAAM,0CAAE,KAAK,CAAA;YAClC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;YAClE,CAAC;YACD,OAAO,QAAQ,CAAA;QACjB,CAAC;KAAA;IAED,MAAM,CAAO,UAAU,CAAC,QAAiB;;YACvC,IAAI,CAAC;gBACH,gDAAgD;gBAChD,IAAI,YAAY,GAAW,UAAU,CAAC,aAAa,EAAE,CAAA;gBACrD,IAAI,QAAQ,EAAE,CAAC;oBACb,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAA;oBACpD,YAAY,GAAG,GAAG,YAAY,aAAa,eAAe,EAAE,CAAA;gBAC9D,CAAC;gBAED,IAAA,YAAK,EAAC,mBAAmB,YAAY,EAAE,CAAC,CAAA;gBAExC,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;gBACvD,IAAA,gBAAS,EAAC,QAAQ,CAAC,CAAA;gBACnB,OAAO,QAAQ,CAAA;YACjB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,kBAAkB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;YACpD,CAAC;QACH,CAAC;KAAA;CACF;AAzED,gCAyEC"}

View File

@@ -15,15 +15,27 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || (function () {
if (mod && mod.__esModule) return mod; var ownKeys = function(o) {
var result = {}; ownKeys = Object.getOwnPropertyNames || function (o) {
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); var ar = [];
__setModuleDefault(result, mod); for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return result; return ar;
}; };
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; exports.toPosixPath = toPosixPath;
exports.toWin32Path = toWin32Path;
exports.toPlatformPath = toPlatformPath;
const path = __importStar(require("path")); const path = __importStar(require("path"));
/** /**
* toPosixPath converts the given path to the posix form. On Windows, \\ will be * toPosixPath converts the given path to the posix form. On Windows, \\ will be
@@ -35,7 +47,6 @@ const path = __importStar(require("path"));
function toPosixPath(pth) { function toPosixPath(pth) {
return pth.replace(/[\\]/g, '/'); return pth.replace(/[\\]/g, '/');
} }
exports.toPosixPath = toPosixPath;
/** /**
* toWin32Path converts the given path to the win32 form. On Linux, / will be * toWin32Path converts the given path to the win32 form. On Linux, / will be
* replaced with \\. * replaced with \\.
@@ -46,7 +57,6 @@ exports.toPosixPath = toPosixPath;
function toWin32Path(pth) { function toWin32Path(pth) {
return pth.replace(/[/]/g, '\\'); return pth.replace(/[/]/g, '\\');
} }
exports.toWin32Path = toWin32Path;
/** /**
* toPlatformPath converts the given path to a platform-specific path. It does * toPlatformPath converts the given path to a platform-specific path. It does
* this by replacing instances of / and \ with the platform-specific path * this by replacing instances of / and \ with the platform-specific path
@@ -58,5 +68,4 @@ exports.toWin32Path = toWin32Path;
function toPlatformPath(pth) { function toPlatformPath(pth) {
return pth.replace(/[/\\]/g, path.sep); return pth.replace(/[/\\]/g, path.sep);
} }
exports.toPlatformPath = toPlatformPath;
//# sourceMappingURL=path-utils.js.map //# sourceMappingURL=path-utils.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../src/path-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4B;AAE5B;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAClC,CAAC;AAFD,kCAEC;AAED;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAClC,CAAC;AAFD,kCAEC;AAED;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,GAAW;IACxC,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,wCAEC"} {"version":3,"file":"path-utils.js","sourceRoot":"","sources":["../src/path-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,kCAEC;AASD,kCAEC;AAUD,wCAEC;AAlCD,2CAA4B;AAE5B;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAClC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAClC,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,GAAW;IACxC,OAAO,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC"}

View File

@@ -1,4 +1,3 @@
/// <reference types="node" />
export declare const platform: NodeJS.Platform; export declare const platform: NodeJS.Platform;
export declare const arch: string; export declare const arch: string;
export declare const isWindows: boolean; export declare const isWindows: boolean;

View File

@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || (function () {
if (mod && mod.__esModule) return mod; var ownKeys = function(o) {
var result = {}; ownKeys = Object.getOwnPropertyNames || function (o) {
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); var ar = [];
__setModuleDefault(result, mod); for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return result; return ar;
}; };
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,7 +45,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.getDetails = exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0; exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0;
exports.getDetails = getDetails;
const os_1 = __importDefault(require("os")); const os_1 = __importDefault(require("os"));
const exec = __importStar(require("@actions/exec")); const exec = __importStar(require("@actions/exec"));
const getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () { const getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () {
@@ -90,5 +101,4 @@ function getDetails() {
isLinux: exports.isLinux }); isLinux: exports.isLinux });
}); });
} }
exports.getDetails = getDetails;
//# sourceMappingURL=platform.js.map //# sourceMappingURL=platform.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAmB;AACnB,oDAAqC;AAErC,MAAM,cAAc,GAAG,GAAmD,EAAE;IAC1E,MAAM,EAAC,MAAM,EAAE,OAAO,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAChD,kFAAkF,EAClF,SAAS,EACT;QACE,MAAM,EAAE,IAAI;KACb,CACF,CAAA;IAED,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAC7C,kFAAkF,EAClF,SAAS,EACT;QACE,MAAM,EAAE,IAAI;KACb,CACF,CAAA;IAED,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;QACjB,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;KACxB,CAAA;AACH,CAAC,CAAA,CAAA;AAED,MAAM,YAAY,GAAG,GAGlB,EAAE;;IACH,MAAM,EAAC,MAAM,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE;QAC9D,MAAM,EAAE,IAAI;KACb,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,MAAA,MAAA,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,0CAAG,CAAC,CAAC,mCAAI,EAAE,CAAA;IACjE,MAAM,IAAI,GAAG,MAAA,MAAA,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,0CAAG,CAAC,CAAC,mCAAI,EAAE,CAAA;IAE3D,OAAO;QACL,IAAI;QACJ,OAAO;KACR,CAAA;AACH,CA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AA;AAEY,QAAA,QAAQ,GAAG,YAAE,CAAC,QAAQ,EAAE,CAAA;AACxB,QAAA,IAAI,GAAG,YAAE,CAAC,IAAI,EAAE,CAAA;AAChB,QAAA,SAAS,GAAG,gBAAQ,KAAK,OAAO,CAAA;AAChC,QAAA,OAAO,GAAG,gBAAQ,KAAK,QAAQ,CAAA;AAC/B,QAAA,OAAO,GAAG,gBAAQ,KAAK,OAAO,CAAA;AAE3C,SAAsB,UAAU;;QAS9B,uCACK,CAAC,MAAM,CAAC,iBAAS;YAClB,CAAC,CAAC,cAAc,EAAE;YAClB,CAAC,CAAC,eAAO;gBACP,CAAC,CAAC,YAAY,EAAE;gBAChB,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,KACtB,QAAQ,EAAR,gBAAQ;YACR,IAAI,EAAJ,YAAI;YACJ,SAAS,EAAT,iBAAS;YACT,OAAO,EAAP,eAAO;YACP,OAAO,EAAP,eAAO,IACR;IACH,CAAC;CAAA"}

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,8 @@
// We use any as a valid input type // We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.toCommandProperties = exports.toCommandValue = void 0; exports.toCommandValue = toCommandValue;
exports.toCommandProperties = toCommandProperties;
/** /**
* Sanitizes an input into a string so it can be passed into issueCommand safely * Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string * @param input input to sanitize into a string
@@ -16,7 +17,6 @@ function toCommandValue(input) {
} }
return JSON.stringify(input); return JSON.stringify(input);
} }
exports.toCommandValue = toCommandValue;
/** /**
* *
* @param annotationProperties * @param annotationProperties
@@ -36,5 +36,4 @@ function toCommandProperties(annotationProperties) {
endColumn: annotationProperties.endColumn endColumn: annotationProperties.endColumn
}; };
} }
exports.toCommandProperties = toCommandProperties;
//# sourceMappingURL=utils.js.map //# sourceMappingURL=utils.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,uDAAuD;;;AAKvD;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAAU;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,OAAO,EAAE,CAAA;KACV;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,EAAE;QAC/D,OAAO,KAAe,CAAA;KACvB;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAPD,wCAOC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CACjC,oBAA0C;IAE1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,MAAM,EAAE;QAC7C,OAAO,EAAE,CAAA;KACV;IAED,OAAO;QACL,KAAK,EAAE,oBAAoB,CAAC,KAAK;QACjC,IAAI,EAAE,oBAAoB,CAAC,IAAI;QAC/B,IAAI,EAAE,oBAAoB,CAAC,SAAS;QACpC,OAAO,EAAE,oBAAoB,CAAC,OAAO;QACrC,GAAG,EAAE,oBAAoB,CAAC,WAAW;QACrC,SAAS,EAAE,oBAAoB,CAAC,SAAS;KAC1C,CAAA;AACH,CAAC;AAfD,kDAeC"} {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,uDAAuD;;AASvD,wCAOC;AAQD,kDAeC;AAlCD;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAAU;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAA;IACX,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,EAAE,CAAC;QAChE,OAAO,KAAe,CAAA;IACxB,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CACjC,oBAA0C;IAE1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,MAAM,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAA;IACX,CAAC;IAED,OAAO;QACL,KAAK,EAAE,oBAAoB,CAAC,KAAK;QACjC,IAAI,EAAE,oBAAoB,CAAC,IAAI;QAC/B,IAAI,EAAE,oBAAoB,CAAC,SAAS;QACpC,OAAO,EAAE,oBAAoB,CAAC,OAAO;QACrC,GAAG,EAAE,oBAAoB,CAAC,WAAW;QACrC,SAAS,EAAE,oBAAoB,CAAC,SAAS;KAC1C,CAAA;AACH,CAAC"}

View File

@@ -1,6 +1,6 @@
{ {
"name": "@actions/core", "name": "@actions/core",
"version": "1.11.1", "version": "2.0.1",
"description": "Actions core lib", "description": "Actions core lib",
"keywords": [ "keywords": [
"github", "github",
@@ -36,8 +36,8 @@
"url": "https://github.com/actions/toolkit/issues" "url": "https://github.com/actions/toolkit/issues"
}, },
"dependencies": { "dependencies": {
"@actions/exec": "^1.1.1", "@actions/exec": "^2.0.0",
"@actions/http-client": "^2.0.1" "@actions/http-client": "^3.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^16.18.112" "@types/node": "^16.18.112"

View File

@@ -1,7 +1,11 @@
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@@ -11,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || (function () {
if (mod && mod.__esModule) return mod; var ownKeys = function(o) {
var result = {}; ownKeys = Object.getOwnPropertyNames || function (o) {
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); var ar = [];
__setModuleDefault(result, mod); for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return result; return ar;
}; };
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
@@ -28,7 +42,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}); });
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.getExecOutput = exports.exec = void 0; exports.exec = exec;
exports.getExecOutput = getExecOutput;
const string_decoder_1 = require("string_decoder"); const string_decoder_1 = require("string_decoder");
const tr = __importStar(require("./toolrunner")); const tr = __importStar(require("./toolrunner"));
/** /**
@@ -54,7 +69,6 @@ function exec(commandLine, args, options) {
return runner.exec(); return runner.exec();
}); });
} }
exports.exec = exec;
/** /**
* Exec a command and get the output. * Exec a command and get the output.
* Output will be streamed to the live console. * Output will be streamed to the live console.
@@ -66,8 +80,8 @@ exports.exec = exec;
* @returns Promise<ExecOutput> exit code, stdout, and stderr * @returns Promise<ExecOutput> exit code, stdout, and stderr
*/ */
function getExecOutput(commandLine, args, options) { function getExecOutput(commandLine, args, options) {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
var _a, _b;
let stdout = ''; let stdout = '';
let stderr = ''; let stderr = '';
//Using string decoder covers the case where a mult-byte character is split //Using string decoder covers the case where a mult-byte character is split
@@ -99,5 +113,4 @@ function getExecOutput(commandLine, args, options) {
}; };
}); });
} }
exports.getExecOutput = getExecOutput;
//# sourceMappingURL=exec.js.map //# sourceMappingURL=exec.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAA4C;AAE5C,iDAAkC;AAIlC;;;;;;;;;GASG;AACH,SAAsB,IAAI,CACxB,WAAmB,EACnB,IAAe,EACf,OAAqB;;QAErB,MAAM,WAAW,GAAG,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAA;QACpD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;SACpE;QACD,8CAA8C;QAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;QAC/B,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;QAC9C,MAAM,MAAM,GAAkB,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QACxE,OAAO,MAAM,CAAC,IAAI,EAA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0CAAE,MAAM,CAAA;QACzD,MAAM,sBAAsB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,0CAAE,MAAM,CAAA;QAEzD,MAAM,cAAc,GAAG,CAAC,IAAY,EAAQ,EAAE;YAC5C,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACnC,IAAI,sBAAsB,EAAE,CAAC;gBAC3B,sBAAsB,CAAC,IAAI,CAAC,CAAA;YAC9B,CAAC;QACH,CAAC,CAAA;QAED,MAAM,cAAc,GAAG,CAAC,IAAY,EAAQ,EAAE;YAC5C,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACnC,IAAI,sBAAsB,EAAE,CAAC;gBAC3B,sBAAsB,CAAC,IAAI,CAAC,CAAA;YAC9B,CAAC;QACH,CAAC,CAAA;QAED,MAAM,SAAS,mCACV,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,KACrB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,GACvB,CAAA;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,IAAI,kCAAM,OAAO,KAAE,SAAS,IAAE,CAAA;QAEvE,gCAAgC;QAChC,MAAM,IAAI,aAAa,CAAC,GAAG,EAAE,CAAA;QAC7B,MAAM,IAAI,aAAa,CAAC,GAAG,EAAE,CAAA;QAE7B,OAAO;YACL,QAAQ;YACR,MAAM;YACN,MAAM;SACP,CAAA;IACH,CAAC;CAAA"}

View File

@@ -1,4 +1,3 @@
/// <reference types="node" />
import * as stream from 'stream'; import * as stream from 'stream';
/** /**
* Interface for exec options * Interface for exec options

View File

@@ -1,4 +1,3 @@
/// <reference types="node" />
import * as events from 'events'; import * as events from 'events';
import * as im from './interfaces'; import * as im from './interfaces';
export declare class ToolRunner extends events.EventEmitter { export declare class ToolRunner extends events.EventEmitter {

View File

@@ -1,7 +1,11 @@
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@@ -11,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || (function () {
if (mod && mod.__esModule) return mod; var ownKeys = function(o) {
var result = {}; ownKeys = Object.getOwnPropertyNames || function (o) {
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); var ar = [];
__setModuleDefault(result, mod); for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return result; return ar;
}; };
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
@@ -28,7 +42,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}); });
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.argStringToArray = exports.ToolRunner = void 0; exports.ToolRunner = void 0;
exports.argStringToArray = argStringToArray;
const os = __importStar(require("os")); const os = __importStar(require("os"));
const events = __importStar(require("events")); const events = __importStar(require("events"));
const child = __importStar(require("child_process")); const child = __importStar(require("child_process"));
@@ -260,10 +275,7 @@ class ToolRunner extends events.EventEmitter {
} }
} }
reverse += '"'; reverse += '"';
return reverse return reverse.split('').reverse().join('');
.split('')
.reverse()
.join('');
} }
_uvQuoteCmdArg(arg) { _uvQuoteCmdArg(arg) {
// Tool runner wraps child_process.spawn() and needs to apply the same quoting as // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
@@ -339,10 +351,7 @@ class ToolRunner extends events.EventEmitter {
} }
} }
reverse += '"'; reverse += '"';
return reverse return reverse.split('').reverse().join('');
.split('')
.reverse()
.join('');
} }
_cloneExecOptions(options) { _cloneExecOptions(options) {
options = options || {}; options = options || {};
@@ -546,7 +555,6 @@ function argStringToArray(argString) {
} }
return args; return args;
} }
exports.argStringToArray = argStringToArray;
class ExecState extends events.EventEmitter { class ExecState extends events.EventEmitter {
constructor(options, toolPath) { constructor(options, toolPath) {
super(); super();
@@ -575,7 +583,7 @@ class ExecState extends events.EventEmitter {
this._setResult(); this._setResult();
} }
else if (this.processExited) { else if (this.processExited) {
this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this); this.timeout = (0, timers_1.setTimeout)(ExecState.HandleTimeout, this.delay, this);
} }
} }
_debug(message) { _debug(message) {
@@ -608,8 +616,7 @@ class ExecState extends events.EventEmitter {
return; return;
} }
if (!state.processClosed && state.processExited) { if (!state.processClosed && state.processExited) {
const message = `The STDIO streams did not close within ${state.delay / const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
state._debug(message); state._debug(message);
} }
state._setResult(); state._setResult();

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{ {
"name": "@actions/exec", "name": "@actions/exec",
"version": "1.1.1", "version": "2.0.0",
"description": "Actions exec lib", "description": "Actions exec lib",
"keywords": [ "keywords": [
"github", "github",
@@ -36,6 +36,6 @@
"url": "https://github.com/actions/toolkit/issues" "url": "https://github.com/actions/toolkit/issues"
}, },
"dependencies": { "dependencies": {
"@actions/io": "^1.0.1" "@actions/io": "^2.0.0"
} }
} }

View File

@@ -7,7 +7,7 @@ A lightweight HTTP client optimized for building actions.
- HTTP client with TypeScript generics and async/await/Promises - HTTP client with TypeScript generics and async/await/Promises
- Typings included! - Typings included!
- [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner - [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner
- Targets ES2019 (runner runs actions with node 12+). Only supported on node 12+. - Targets ES2019 (runner runs actions with node 24+). Only supported on node 20+.
- Basic, Bearer and PAT Support out of the box. Extensible handlers for others. - Basic, Bearer and PAT Support out of the box. Extensible handlers for others.
- Redirects supported - Redirects supported
@@ -44,7 +44,7 @@ export NODE_DEBUG=http
## Node support ## Node support
The http-client is built using the latest LTS version of Node 12. It may work on previous node LTS versions but it's tested and officially supported on Node12+. The http-client is built using Node 24. It may work on previous node LTS versions but it's tested and officially supported on Node 20+.
## Support and Versioning ## Support and Versioning

View File

@@ -1,4 +1,3 @@
/// <reference types="node" />
import * as http from 'http'; import * as http from 'http';
import * as ifm from './interfaces'; import * as ifm from './interfaces';
import { HttpClientResponse } from './index'; import { HttpClientResponse } from './index';

View File

@@ -1 +1 @@
{"version":3,"file":"auth.js","sourceRoot":"","sources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ACF;AA1BD,wDA0BC;AAED,MAAa,uBAAuB;IAGlC,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,yCAAyC;IACzC,sDAAsD;IACtD,cAAc,CAAC,OAA4B;QACzC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,IAAI,CAAC,KAAK,EAAE,CAAA;IAC3D,CAAC;IAED,iCAAiC;IACjC,uBAAuB;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAEK,oBAAoB;;YACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACpC,CAAC;KAAA;CACF;AAxBD,0DAwBC;AAED,MAAa,oCAAoC;IAK/C,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,yCAAyC;IACzC,sDAAsD;IACtD,cAAc,CAAC,OAA4B;QACzC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,MAAM,CAAC,IAAI,CACrD,OAAO,IAAI,CAAC,KAAK,EAAE,CACpB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;IACxB,CAAC;IAED,iCAAiC;IACjC,uBAAuB;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAEK,oBAAoB;;YACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACpC,CAAC;KAAA;CACF;AA5BD,oFA4BC"}

View File

@@ -1,6 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import * as http from 'http'; import * as http from 'http';
import * as ifm from './interfaces'; import * as ifm from './interfaces';
import { ProxyAgent } from 'undici'; import { ProxyAgent } from 'undici';
@@ -122,7 +119,22 @@ export declare class HttpClient {
getAgentDispatcher(serverUrl: string): ProxyAgent | undefined; getAgentDispatcher(serverUrl: string): ProxyAgent | undefined;
private _prepareRequest; private _prepareRequest;
private _mergeHeaders; private _mergeHeaders;
/**
* Gets an existing header value or returns a default.
* Handles converting number header values to strings since HTTP headers must be strings.
* Note: This returns string | string[] since some headers can have multiple values.
* For headers that must always be a single string (like Content-Type), use the
* specialized _getExistingOrDefaultContentTypeHeader method instead.
*/
private _getExistingOrDefaultHeader; private _getExistingOrDefaultHeader;
/**
* Specialized version of _getExistingOrDefaultHeader for Content-Type header.
* Always returns a single string (not an array) since Content-Type should be a single value.
* Converts arrays to comma-separated strings and numbers to strings to ensure type safety.
* This was split from _getExistingOrDefaultHeader to provide stricter typing for callers
* that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).
*/
private _getExistingOrDefaultContentTypeHeader;
private _getAgent; private _getAgent;
private _getProxyAgentDispatcher; private _getProxyAgentDispatcher;
private _performExponentialBackoff; private _performExponentialBackoff;

View File

@@ -16,13 +16,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || (function () {
if (mod && mod.__esModule) return mod; var ownKeys = function(o) {
var result = {}; ownKeys = Object.getOwnPropertyNames || function (o) {
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); var ar = [];
__setModuleDefault(result, mod); for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return result; return ar;
}; };
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
@@ -33,7 +43,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}); });
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; exports.HttpClient = exports.HttpClientResponse = exports.HttpClientError = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
exports.getProxyUrl = getProxyUrl;
exports.isHttps = isHttps;
const http = __importStar(require("http")); const http = __importStar(require("http"));
const https = __importStar(require("https")); const https = __importStar(require("https"));
const pm = __importStar(require("./proxy")); const pm = __importStar(require("./proxy"));
@@ -86,7 +98,6 @@ function getProxyUrl(serverUrl) {
const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
return proxyUrl ? proxyUrl.href : ''; return proxyUrl ? proxyUrl.href : '';
} }
exports.getProxyUrl = getProxyUrl;
const HttpRedirectCodes = [ const HttpRedirectCodes = [
HttpCodes.MovedPermanently, HttpCodes.MovedPermanently,
HttpCodes.ResourceMoved, HttpCodes.ResourceMoved,
@@ -147,7 +158,6 @@ function isHttps(requestUrl) {
const parsedUrl = new URL(requestUrl); const parsedUrl = new URL(requestUrl);
return parsedUrl.protocol === 'https:'; return parsedUrl.protocol === 'https:';
} }
exports.isHttps = isHttps;
class HttpClient { class HttpClient {
constructor(userAgent, handlers, requestOptions) { constructor(userAgent, handlers, requestOptions) {
this._ignoreSslError = false; this._ignoreSslError = false;
@@ -230,36 +240,39 @@ class HttpClient {
* Gets a typed object from an endpoint * Gets a typed object from an endpoint
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
*/ */
getJson(requestUrl, additionalHeaders = {}) { getJson(requestUrl_1) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) {
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
const res = yield this.get(requestUrl, additionalHeaders); const res = yield this.get(requestUrl, additionalHeaders);
return this._processResponse(res, this.requestOptions); return this._processResponse(res, this.requestOptions);
}); });
} }
postJson(requestUrl, obj, additionalHeaders = {}) { postJson(requestUrl_1, obj_1) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
const data = JSON.stringify(obj, null, 2); const data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); additionalHeaders[Headers.ContentType] =
this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
const res = yield this.post(requestUrl, data, additionalHeaders); const res = yield this.post(requestUrl, data, additionalHeaders);
return this._processResponse(res, this.requestOptions); return this._processResponse(res, this.requestOptions);
}); });
} }
putJson(requestUrl, obj, additionalHeaders = {}) { putJson(requestUrl_1, obj_1) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
const data = JSON.stringify(obj, null, 2); const data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); additionalHeaders[Headers.ContentType] =
this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
const res = yield this.put(requestUrl, data, additionalHeaders); const res = yield this.put(requestUrl, data, additionalHeaders);
return this._processResponse(res, this.requestOptions); return this._processResponse(res, this.requestOptions);
}); });
} }
patchJson(requestUrl, obj, additionalHeaders = {}) { patchJson(requestUrl_1, obj_1) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) {
const data = JSON.stringify(obj, null, 2); const data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); additionalHeaders[Headers.ContentType] =
this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson);
const res = yield this.patch(requestUrl, data, additionalHeaders); const res = yield this.patch(requestUrl, data, additionalHeaders);
return this._processResponse(res, this.requestOptions); return this._processResponse(res, this.requestOptions);
}); });
@@ -488,12 +501,73 @@ class HttpClient {
} }
return lowercaseKeys(headers || {}); return lowercaseKeys(headers || {});
} }
/**
* Gets an existing header value or returns a default.
* Handles converting number header values to strings since HTTP headers must be strings.
* Note: This returns string | string[] since some headers can have multiple values.
* For headers that must always be a single string (like Content-Type), use the
* specialized _getExistingOrDefaultContentTypeHeader method instead.
*/
_getExistingOrDefaultHeader(additionalHeaders, header, _default) { _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
let clientHeader; let clientHeader;
if (this.requestOptions && this.requestOptions.headers) { if (this.requestOptions && this.requestOptions.headers) {
clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; const headerValue = lowercaseKeys(this.requestOptions.headers)[header];
if (headerValue) {
clientHeader =
typeof headerValue === 'number' ? headerValue.toString() : headerValue;
}
} }
return additionalHeaders[header] || clientHeader || _default; const additionalValue = additionalHeaders[header];
if (additionalValue !== undefined) {
return typeof additionalValue === 'number'
? additionalValue.toString()
: additionalValue;
}
if (clientHeader !== undefined) {
return clientHeader;
}
return _default;
}
/**
* Specialized version of _getExistingOrDefaultHeader for Content-Type header.
* Always returns a single string (not an array) since Content-Type should be a single value.
* Converts arrays to comma-separated strings and numbers to strings to ensure type safety.
* This was split from _getExistingOrDefaultHeader to provide stricter typing for callers
* that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]).
*/
_getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) {
let clientHeader;
if (this.requestOptions && this.requestOptions.headers) {
const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType];
if (headerValue) {
if (typeof headerValue === 'number') {
clientHeader = String(headerValue);
}
else if (Array.isArray(headerValue)) {
clientHeader = headerValue.join(', ');
}
else {
clientHeader = headerValue;
}
}
}
const additionalValue = additionalHeaders[Headers.ContentType];
// Return the first non-undefined value, converting numbers or arrays to strings if necessary
if (additionalValue !== undefined) {
if (typeof additionalValue === 'number') {
return String(additionalValue);
}
else if (Array.isArray(additionalValue)) {
return additionalValue.join(', ');
}
else {
return additionalValue;
}
}
if (clientHeader !== undefined) {
return clientHeader;
}
return _default;
} }
_getAgent(parsedUrl) { _getAgent(parsedUrl) {
let agent; let agent;

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import * as http from 'http'; import * as http from 'http';
import * as https from 'https'; import * as https from 'https';
import { HttpClientResponse } from './index'; import { HttpClientResponse } from './index';

View File

@@ -1,6 +1,7 @@
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.checkBypass = exports.getProxyUrl = void 0; exports.getProxyUrl = getProxyUrl;
exports.checkBypass = checkBypass;
function getProxyUrl(reqUrl) { function getProxyUrl(reqUrl) {
const usingSsl = reqUrl.protocol === 'https:'; const usingSsl = reqUrl.protocol === 'https:';
if (checkBypass(reqUrl)) { if (checkBypass(reqUrl)) {
@@ -27,7 +28,6 @@ function getProxyUrl(reqUrl) {
return undefined; return undefined;
} }
} }
exports.getProxyUrl = getProxyUrl;
function checkBypass(reqUrl) { function checkBypass(reqUrl) {
if (!reqUrl.hostname) { if (!reqUrl.hostname) {
return false; return false;
@@ -71,7 +71,6 @@ function checkBypass(reqUrl) {
} }
return false; return false;
} }
exports.checkBypass = checkBypass;
function isLoopbackAddress(host) { function isLoopbackAddress(host) {
const hostLower = host.toLowerCase(); const hostLower = host.toLowerCase();
return (hostLower === 'localhost' || return (hostLower === 'localhost' ||

View File

@@ -1 +1 @@
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,MAAW;IACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAA;IAE7C,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE;QACvB,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE;QACrB,IAAI,QAAQ,EAAE;YACZ,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC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0",
"description": "Actions Http Client", "description": "Actions Http Client",
"keywords": [ "keywords": [
"github", "github",
@@ -39,13 +39,16 @@
"url": "https://github.com/actions/toolkit/issues" "url": "https://github.com/actions/toolkit/issues"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "20.7.1", "@types/node": "24.1.0",
"@types/tunnel": "0.0.3", "@types/tunnel": "0.0.3",
"proxy": "^2.1.1", "proxy": "^2.1.1",
"@types/proxy": "^1.0.1" "@types/proxy": "^1.0.1"
}, },
"dependencies": { "dependencies": {
"tunnel": "^0.0.6", "tunnel": "^0.0.6",
"undici": "^5.25.4" "undici": "^5.28.5"
},
"overrides": {
"uri-js": "npm:uri-js-replace@^1.0.1"
} }
} }

View File

@@ -1,7 +1,18 @@
/// <reference types="node" />
import * as fs from 'fs'; import * as fs from 'fs';
export declare const chmod: typeof fs.promises.chmod, copyFile: typeof fs.promises.copyFile, lstat: typeof fs.promises.lstat, mkdir: typeof fs.promises.mkdir, open: typeof fs.promises.open, readdir: typeof fs.promises.readdir, readlink: typeof fs.promises.readlink, rename: typeof fs.promises.rename, rm: typeof fs.promises.rm, rmdir: typeof fs.promises.rmdir, stat: typeof fs.promises.stat, symlink: typeof fs.promises.symlink, unlink: typeof fs.promises.unlink; export declare const chmod: typeof fs.promises.chmod, copyFile: typeof fs.promises.copyFile, lstat: typeof fs.promises.lstat, mkdir: typeof fs.promises.mkdir, open: typeof fs.promises.open, readdir: typeof fs.promises.readdir, rename: typeof fs.promises.rename, rm: typeof fs.promises.rm, rmdir: typeof fs.promises.rmdir, stat: typeof fs.promises.stat, symlink: typeof fs.promises.symlink, unlink: typeof fs.promises.unlink;
export declare const IS_WINDOWS: boolean; export declare const IS_WINDOWS: boolean;
/**
* Custom implementation of readlink to ensure Windows junctions
* maintain trailing backslash for backward compatibility with Node.js < 24
*
* In Node.js 20, Windows junctions (directory symlinks) always returned paths
* with trailing backslashes. Node.js 24 removed this behavior, which breaks
* code that relied on this format for path operations.
*
* This implementation restores the Node 20 behavior by adding a trailing
* backslash to all junction results on Windows.
*/
export declare function readlink(fsPath: string): Promise<string>;
export declare const UV_FS_O_EXLOCK = 268435456; export declare const UV_FS_O_EXLOCK = 268435456;
export declare const READONLY: number; export declare const READONLY: number;
export declare function exists(fsPath: string): Promise<boolean>; export declare function exists(fsPath: string): Promise<boolean>;

View File

@@ -1,7 +1,11 @@
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@@ -11,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || (function () {
if (mod && mod.__esModule) return mod; var ownKeys = function(o) {
var result = {}; ownKeys = Object.getOwnPropertyNames || function (o) {
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); var ar = [];
__setModuleDefault(result, mod); for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return result; return ar;
}; };
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
@@ -29,21 +43,49 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}; };
var _a; var _a;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;
exports.readlink = readlink;
exports.exists = exists;
exports.isDirectory = isDirectory;
exports.isRooted = isRooted;
exports.tryGetExecutablePath = tryGetExecutablePath;
exports.getCmdPath = getCmdPath;
const fs = __importStar(require("fs")); const fs = __importStar(require("fs"));
const path = __importStar(require("path")); const path = __importStar(require("path"));
_a = fs.promises _a = fs.promises
// export const {open} = 'fs' // export const {open} = 'fs'
, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; , exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
// export const {open} = 'fs' // export const {open} = 'fs'
exports.IS_WINDOWS = process.platform === 'win32'; exports.IS_WINDOWS = process.platform === 'win32';
/**
* Custom implementation of readlink to ensure Windows junctions
* maintain trailing backslash for backward compatibility with Node.js < 24
*
* In Node.js 20, Windows junctions (directory symlinks) always returned paths
* with trailing backslashes. Node.js 24 removed this behavior, which breaks
* code that relied on this format for path operations.
*
* This implementation restores the Node 20 behavior by adding a trailing
* backslash to all junction results on Windows.
*/
function readlink(fsPath) {
return __awaiter(this, void 0, void 0, function* () {
const result = yield fs.promises.readlink(fsPath);
// On Windows, restore Node 20 behavior: add trailing backslash to all results
// since junctions on Windows are always directory links
if (exports.IS_WINDOWS && !result.endsWith('\\')) {
return `${result}\\`;
}
return result;
});
}
// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691
exports.UV_FS_O_EXLOCK = 0x10000000; exports.UV_FS_O_EXLOCK = 0x10000000;
exports.READONLY = fs.constants.O_RDONLY; exports.READONLY = fs.constants.O_RDONLY;
function exists(fsPath) { function exists(fsPath) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
yield exports.stat(fsPath); yield (0, exports.stat)(fsPath);
} }
catch (err) { catch (err) {
if (err.code === 'ENOENT') { if (err.code === 'ENOENT') {
@@ -54,14 +96,12 @@ function exists(fsPath) {
return true; return true;
}); });
} }
exports.exists = exists; function isDirectory(fsPath_1) {
function isDirectory(fsPath, useStat = false) { return __awaiter(this, arguments, void 0, function* (fsPath, useStat = false) {
return __awaiter(this, void 0, void 0, function* () { const stats = useStat ? yield (0, exports.stat)(fsPath) : yield (0, exports.lstat)(fsPath);
const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
return stats.isDirectory(); return stats.isDirectory();
}); });
} }
exports.isDirectory = isDirectory;
/** /**
* On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
* \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
@@ -77,7 +117,6 @@ function isRooted(p) {
} }
return p.startsWith('/'); return p.startsWith('/');
} }
exports.isRooted = isRooted;
/** /**
* Best effort attempt to determine whether a file exists and is executable. * Best effort attempt to determine whether a file exists and is executable.
* @param filePath file path to check * @param filePath file path to check
@@ -89,7 +128,7 @@ function tryGetExecutablePath(filePath, extensions) {
let stats = undefined; let stats = undefined;
try { try {
// test file exists // test file exists
stats = yield exports.stat(filePath); stats = yield (0, exports.stat)(filePath);
} }
catch (err) { catch (err) {
if (err.code !== 'ENOENT') { if (err.code !== 'ENOENT') {
@@ -117,7 +156,7 @@ function tryGetExecutablePath(filePath, extensions) {
filePath = originalFilePath + extension; filePath = originalFilePath + extension;
stats = undefined; stats = undefined;
try { try {
stats = yield exports.stat(filePath); stats = yield (0, exports.stat)(filePath);
} }
catch (err) { catch (err) {
if (err.code !== 'ENOENT') { if (err.code !== 'ENOENT') {
@@ -131,7 +170,7 @@ function tryGetExecutablePath(filePath, extensions) {
try { try {
const directory = path.dirname(filePath); const directory = path.dirname(filePath);
const upperName = path.basename(filePath).toUpperCase(); const upperName = path.basename(filePath).toUpperCase();
for (const actualName of yield exports.readdir(directory)) { for (const actualName of yield (0, exports.readdir)(directory)) {
if (upperName === actualName.toUpperCase()) { if (upperName === actualName.toUpperCase()) {
filePath = path.join(directory, actualName); filePath = path.join(directory, actualName);
break; break;
@@ -154,7 +193,6 @@ function tryGetExecutablePath(filePath, extensions) {
return ''; return '';
}); });
} }
exports.tryGetExecutablePath = tryGetExecutablePath;
function normalizeSeparators(p) { function normalizeSeparators(p) {
p = p || ''; p = p || '';
if (exports.IS_WINDOWS) { if (exports.IS_WINDOWS) {
@@ -171,13 +209,16 @@ function normalizeSeparators(p) {
// 256 128 64 32 16 8 4 2 1 // 256 128 64 32 16 8 4 2 1
function isUnixExecutable(stats) { function isUnixExecutable(stats) {
return ((stats.mode & 1) > 0 || return ((stats.mode & 1) > 0 ||
((stats.mode & 8) > 0 && stats.gid === process.getgid()) || ((stats.mode & 8) > 0 &&
((stats.mode & 64) > 0 && stats.uid === process.getuid())); process.getgid !== undefined &&
stats.gid === process.getgid()) ||
((stats.mode & 64) > 0 &&
process.getuid !== undefined &&
stats.uid === process.getuid()));
} }
// Get the path of cmd.exe in windows // Get the path of cmd.exe in windows
function getCmdPath() { function getCmdPath() {
var _a; var _a;
return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;
} }
exports.getCmdPath = getCmdPath;
//# sourceMappingURL=io-util.js.map //# sourceMappingURL=io-util.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"io-util.js","sourceRoot":"","sources":["../src/io-util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,2CAA4B;AAEf,KAcT,EAAE,CAAC,QAAQ;AACf,6BAA6B;EAd3B,aAAK,aACL,gBAAQ,gBACR,aAAK,aACL,aAAK,aACL,YAAI,YACJ,eAAO,eACP,gBAAQ,gBACR,cAAM,cACN,UAAE,UACF,aAAK,aACL,YAAI,YACJ,eAAO,eACP,cAAM,aACO;AACf,6BAA6B;AAChB,QAAA,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;AACtD,iHAAiH;AACpG,QAAA,cAAc,GAAG,UAAU,CAAA;AAC3B,QAAA,QAAQ,GAAG,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAA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AK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC;QACpB,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC;YACnB,OAAO,CAAC,MAAM,KAAK,SAAS;YAC5B,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;QACjC,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC;YACpB,OAAO,CAAC,MAAM,KAAK,SAAS;YAC5B,KAAK,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAClC,CAAA;AACH,CAAC;AAED,qCAAqC;AACrC,SAAgB,UAAU;;IACxB,OAAO,MAAA,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,mCAAI,SAAS,CAAA;AAC5C,CAAC"}

53
node_modules/@actions/io/lib/io.js generated vendored
View File

@@ -1,7 +1,11 @@
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
@@ -11,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || (function () {
if (mod && mod.__esModule) return mod; var ownKeys = function(o) {
var result = {}; ownKeys = Object.getOwnPropertyNames || function (o) {
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); var ar = [];
__setModuleDefault(result, mod); for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return result; return ar;
}; };
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
@@ -28,7 +42,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}); });
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; exports.cp = cp;
exports.mv = mv;
exports.rmRF = rmRF;
exports.mkdirP = mkdirP;
exports.which = which;
exports.findInPath = findInPath;
const assert_1 = require("assert"); const assert_1 = require("assert");
const path = __importStar(require("path")); const path = __importStar(require("path"));
const ioUtil = __importStar(require("./io-util")); const ioUtil = __importStar(require("./io-util"));
@@ -40,8 +59,8 @@ const ioUtil = __importStar(require("./io-util"));
* @param dest destination path * @param dest destination path
* @param options optional. See CopyOptions. * @param options optional. See CopyOptions.
*/ */
function cp(source, dest, options = {}) { function cp(source_1, dest_1) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {
const { force, recursive, copySourceDirectory } = readCopyOptions(options); const { force, recursive, copySourceDirectory } = readCopyOptions(options);
const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
// Dest is an existing file, but not forcing // Dest is an existing file, but not forcing
@@ -73,7 +92,6 @@ function cp(source, dest, options = {}) {
} }
}); });
} }
exports.cp = cp;
/** /**
* Moves a path. * Moves a path.
* *
@@ -81,8 +99,8 @@ exports.cp = cp;
* @param dest destination path * @param dest destination path
* @param options optional. See MoveOptions. * @param options optional. See MoveOptions.
*/ */
function mv(source, dest, options = {}) { function mv(source_1, dest_1) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) {
if (yield ioUtil.exists(dest)) { if (yield ioUtil.exists(dest)) {
let destExists = true; let destExists = true;
if (yield ioUtil.isDirectory(dest)) { if (yield ioUtil.isDirectory(dest)) {
@@ -103,7 +121,6 @@ function mv(source, dest, options = {}) {
yield ioUtil.rename(source, dest); yield ioUtil.rename(source, dest);
}); });
} }
exports.mv = mv;
/** /**
* Remove a path recursively with force * Remove a path recursively with force
* *
@@ -132,7 +149,6 @@ function rmRF(inputPath) {
} }
}); });
} }
exports.rmRF = rmRF;
/** /**
* Make a directory. Creates the full path with folders in between * Make a directory. Creates the full path with folders in between
* Will throw if it fails * Will throw if it fails
@@ -142,11 +158,10 @@ exports.rmRF = rmRF;
*/ */
function mkdirP(fsPath) { function mkdirP(fsPath) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
assert_1.ok(fsPath, 'a path argument must be provided'); (0, assert_1.ok)(fsPath, 'a path argument must be provided');
yield ioUtil.mkdir(fsPath, { recursive: true }); yield ioUtil.mkdir(fsPath, { recursive: true });
}); });
} }
exports.mkdirP = mkdirP;
/** /**
* Returns path of a tool had the tool actually been invoked. Resolves via paths. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
* If you check and the tool does not exist, it will throw. * If you check and the tool does not exist, it will throw.
@@ -180,7 +195,6 @@ function which(tool, check) {
return ''; return '';
}); });
} }
exports.which = which;
/** /**
* Returns a list of all occurrences of the given tool on the system path. * Returns a list of all occurrences of the given tool on the system path.
* *
@@ -237,7 +251,6 @@ function findInPath(tool) {
return matches; return matches;
}); });
} }
exports.findInPath = findInPath;
function readCopyOptions(options) { function readCopyOptions(options) {
const force = options.force == null ? true : options.force; const force = options.force == null ? true : options.force;
const recursive = Boolean(options.recursive); const recursive = Boolean(options.recursive);

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{ {
"name": "@actions/io", "name": "@actions/io",
"version": "1.1.3", "version": "2.0.0",
"description": "Actions io lib", "description": "Actions io lib",
"keywords": [ "keywords": [
"github", "github",

20
node_modules/bufferutil/LICENSE generated vendored
View File

@@ -1,20 +0,0 @@
Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
Copyright (c) 2013 Arnout Kazemier and contributors
Copyright (c) 2016 Luigi Pinca and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

79
node_modules/bufferutil/README.md generated vendored
View File

@@ -1,79 +0,0 @@
# bufferutil
[![Version npm](https://img.shields.io/npm/v/bufferutil.svg?logo=npm)](https://www.npmjs.com/package/bufferutil)
[![Linux/macOS/Windows Build](https://img.shields.io/github/actions/workflow/status/websockets/bufferutil/ci.yml?branch=master&label=build&logo=github)](https://github.com/websockets/bufferutil/actions?query=workflow%3ACI+branch%3Amaster)
`bufferutil` is what makes `ws` fast. It provides some utilities to efficiently
perform some operations such as masking and unmasking the data payload of
WebSocket frames.
## Installation
```
npm install bufferutil --save-optional
```
The `--save-optional` flag tells npm to save the package in your package.json
under the
[`optionalDependencies`](https://docs.npmjs.com/files/package.json#optionaldependencies)
key.
## API
The module exports two functions. To maximize performance, parameters are not
validated. It is the caller's responsibility to ensure that they are correct.
### `bufferUtil.mask(source, mask, output, offset, length)`
Masks a buffer using the given masking-key as specified by the WebSocket
protocol.
#### Arguments
- `source` - The buffer to mask.
- `mask` - A buffer representing the masking-key.
- `output` - The buffer where to store the result.
- `offset` - The offset at which to start writing.
- `length` - The number of bytes to mask.
#### Example
```js
'use strict';
const bufferUtil = require('bufferutil');
const crypto = require('crypto');
const source = crypto.randomBytes(10);
const mask = crypto.randomBytes(4);
bufferUtil.mask(source, mask, source, 0, source.length);
```
### `bufferUtil.unmask(buffer, mask)`
Unmasks a buffer using the given masking-key as specified by the WebSocket
protocol.
#### Arguments
- `buffer` - The buffer to unmask.
- `mask` - A buffer representing the masking-key.
#### Example
```js
'use strict';
const bufferUtil = require('bufferutil');
const crypto = require('crypto');
const buffer = crypto.randomBytes(10);
const mask = crypto.randomBytes(4);
bufferUtil.unmask(buffer, mask);
```
## License
[MIT](LICENSE)

32
node_modules/bufferutil/binding.gyp generated vendored
View File

@@ -1,32 +0,0 @@
{
'variables': {
'openssl_fips': ''
},
'targets': [
{
'target_name': 'bufferutil',
'sources': ['src/bufferutil.c'],
'cflags': ['-std=c99'],
'conditions': [
["OS=='mac'", {
'variables': {
'clang_version':
'<!(cc -v 2>&1 | perl -ne \'print $1 if /clang version ([0-9]+(\\.[0-9]+){2,})/\')'
},
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.7'
},
'conditions': [
# Use Perl v-strings to compare versions.
['clang_version and <!(perl -e \'print <(clang_version) cmp 12.0.0\')==1', {
'xcode_settings': {
'OTHER_CFLAGS': ['-arch arm64'],
'OTHER_LDFLAGS': ['-arch arm64']
}
}]
]
}]
]
}
]
}

34
node_modules/bufferutil/fallback.js generated vendored
View File

@@ -1,34 +0,0 @@
'use strict';
/**
* Masks a buffer using the given mask.
*
* @param {Buffer} source The buffer to mask
* @param {Buffer} mask The mask to use
* @param {Buffer} output The buffer where to store the result
* @param {Number} offset The offset at which to start writing
* @param {Number} length The number of bytes to mask.
* @public
*/
const mask = (source, mask, output, offset, length) => {
for (var i = 0; i < length; i++) {
output[offset + i] = source[i] ^ mask[i & 3];
}
};
/**
* Unmasks a buffer using the given mask.
*
* @param {Buffer} buffer The buffer to unmask
* @param {Buffer} mask The mask to use
* @public
*/
const unmask = (buffer, mask) => {
// Required until https://github.com/nodejs/node/issues/9006 is resolved.
const length = buffer.length;
for (var i = 0; i < length; i++) {
buffer[i] ^= mask[i & 3];
}
};
module.exports = { mask, unmask };

7
node_modules/bufferutil/index.js generated vendored
View File

@@ -1,7 +0,0 @@
'use strict';
try {
module.exports = require('node-gyp-build')(__dirname);
} catch (e) {
module.exports = require('./fallback');
}

36
node_modules/bufferutil/package.json generated vendored
View File

@@ -1,36 +0,0 @@
{
"name": "bufferutil",
"version": "4.0.9",
"description": "WebSocket buffer utils",
"main": "index.js",
"engines": {
"node": ">=6.14.2"
},
"scripts": {
"install": "node-gyp-build",
"prebuild": "prebuildify --napi --strip --target=8.11.2",
"prebuild-darwin-x64+arm64": "prebuildify --arch x64+arm64 --napi --strip --target=8.11.2",
"test": "mocha"
},
"repository": {
"type": "git",
"url": "https://github.com/websockets/bufferutil"
},
"keywords": [
"bufferutil"
],
"author": "Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)",
"license": "MIT",
"bugs": {
"url": "https://github.com/websockets/bufferutil/issues"
},
"homepage": "https://github.com/websockets/bufferutil",
"dependencies": {
"node-gyp-build": "^4.3.0"
},
"devDependencies": {
"mocha": "^11.0.1",
"node-gyp": "^11.0.0",
"prebuildify": "^6.0.0"
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,171 +0,0 @@
#define NAPI_VERSION 1
#include <assert.h>
#include <node_api.h>
napi_value Mask(napi_env env, napi_callback_info info) {
napi_status status;
size_t argc = 5;
napi_value argv[5];
status = napi_get_cb_info(env, info, &argc, argv, NULL, NULL);
assert(status == napi_ok);
uint8_t *source;
uint8_t *mask;
uint8_t *destination;
uint32_t offset;
uint32_t length;
status = napi_get_buffer_info(env, argv[0], (void **)&source, NULL);
assert(status == napi_ok);
status = napi_get_buffer_info(env, argv[1], (void **)&mask, NULL);
assert(status == napi_ok);
status = napi_get_buffer_info(env, argv[2], (void **)&destination, NULL);
assert(status == napi_ok);
status = napi_get_value_uint32(env, argv[3], &offset);
assert(status == napi_ok);
status = napi_get_value_uint32(env, argv[4], &length);
assert(status == napi_ok);
destination += offset;
uint32_t index = 0;
//
// Alignment preamble.
//
while (index < length && ((size_t)source % 8)) {
*destination++ = *source++ ^ mask[index % 4];
index++;
}
length -= index;
if (!length)
return NULL;
//
// Realign mask and convert to 64 bit.
//
uint8_t maskAlignedArray[8];
for (uint8_t i = 0; i < 8; i++, index++) {
maskAlignedArray[i] = mask[index % 4];
}
//
// Apply 64 bit mask in 8 byte chunks.
//
uint32_t loop = length / 8;
uint64_t *pMask8 = (uint64_t *)maskAlignedArray;
while (loop--) {
uint64_t *pFrom8 = (uint64_t *)source;
uint64_t *pTo8 = (uint64_t *)destination;
*pTo8 = *pFrom8 ^ *pMask8;
source += 8;
destination += 8;
}
//
// Apply mask to remaining data.
//
uint8_t *pmaskAlignedArray = maskAlignedArray;
length %= 8;
while (length--) {
*destination++ = *source++ ^ *pmaskAlignedArray++;
}
return NULL;
}
napi_value Unmask(napi_env env, napi_callback_info info) {
napi_status status;
size_t argc = 2;
napi_value argv[2];
status = napi_get_cb_info(env, info, &argc, argv, NULL, NULL);
assert(status == napi_ok);
uint8_t *source;
size_t length;
uint8_t *mask;
status = napi_get_buffer_info(env, argv[0], (void **)&source, &length);
assert(status == napi_ok);
status = napi_get_buffer_info(env, argv[1], (void **)&mask, NULL);
assert(status == napi_ok);
uint32_t index = 0;
//
// Alignment preamble.
//
while (index < length && ((size_t)source % 8)) {
*source++ ^= mask[index % 4];
index++;
}
length -= index;
if (!length)
return NULL;
//
// Realign mask and convert to 64 bit.
//
uint8_t maskAlignedArray[8];
for (uint8_t i = 0; i < 8; i++, index++) {
maskAlignedArray[i] = mask[index % 4];
}
//
// Apply 64 bit mask in 8 byte chunks.
//
uint32_t loop = length / 8;
uint64_t *pMask8 = (uint64_t *)maskAlignedArray;
while (loop--) {
uint64_t *pSource8 = (uint64_t *)source;
*pSource8 ^= *pMask8;
source += 8;
}
//
// Apply mask to remaining data.
//
uint8_t *pmaskAlignedArray = maskAlignedArray;
length %= 8;
while (length--) {
*source++ ^= *pmaskAlignedArray++;
}
return NULL;
}
napi_value Init(napi_env env, napi_value exports) {
napi_status status;
napi_value mask;
napi_value unmask;
status = napi_create_function(env, NULL, 0, Mask, NULL, &mask);
assert(status == napi_ok);
status = napi_create_function(env, NULL, 0, Unmask, NULL, &unmask);
assert(status == napi_ok);
status = napi_set_named_property(env, exports, "mask", mask);
assert(status == napi_ok);
status = napi_set_named_property(env, exports, "unmask", unmask);
assert(status == napi_ok);
return exports;
}
NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)

30
node_modules/utf-8-validate/LICENSE generated vendored
View File

@@ -1,30 +0,0 @@
This project is licensed for use as follows:
"""
Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
This license applies to parts originating from
https://www.cl.cam.ac.uk/~mgk25/ucs/utf8_check.c:
"""
Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> -- 2005-03-30
License: http://www.cl.cam.ac.uk/~mgk25/short-license.html
"""

View File

@@ -1,50 +0,0 @@
# utf-8-validate
[![Version npm](https://img.shields.io/npm/v/utf-8-validate.svg?logo=npm)](https://www.npmjs.com/package/utf-8-validate)
[![Linux/macOS/Windows Build](https://img.shields.io/github/workflow/status/websockets/utf-8-validate/CI/master?label=build&logo=github)](https://github.com/websockets/utf-8-validate/actions?query=workflow%3ACI+branch%3Amaster)
Check if a buffer contains valid UTF-8 encoded text.
## Installation
```
npm install utf-8-validate --save-optional
```
The `--save-optional` flag tells npm to save the package in your package.json
under the
[`optionalDependencies`](https://docs.npmjs.com/files/package.json#optionaldependencies)
key.
## API
The module exports a single function which takes one argument.
### `isValidUTF8(buffer)`
Checks whether a buffer contains valid UTF-8.
#### Arguments
- `buffer` - The buffer to check.
#### Return value
`true` if the buffer contains only correct UTF-8, else `false`.
#### Example
```js
'use strict';
const isValidUTF8 = require('utf-8-validate');
const buf = Buffer.from([0xf0, 0x90, 0x80, 0x80]);
console.log(isValidUTF8(buf));
// => true
```
## License
[MIT](LICENSE)

View File

@@ -1,18 +0,0 @@
{
'targets': [
{
'target_name': 'validation',
'sources': ['src/validation.c'],
'cflags': ['-std=c99'],
'conditions': [
["OS=='mac'", {
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'OTHER_CFLAGS': ['-arch x86_64', '-arch arm64'],
'OTHER_LDFLAGS': ['-arch x86_64', '-arch arm64']
}
}]
]
}
]
}

View File

@@ -1,62 +0,0 @@
'use strict';
/**
* Checks if a given buffer contains only correct UTF-8.
* Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by
* Markus Kuhn.
*
* @param {Buffer} buf The buffer to check
* @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`
* @public
*/
function isValidUTF8(buf) {
const len = buf.length;
let i = 0;
while (i < len) {
if ((buf[i] & 0x80) === 0x00) { // 0xxxxxxx
i++;
} else if ((buf[i] & 0xe0) === 0xc0) { // 110xxxxx 10xxxxxx
if (
i + 1 === len ||
(buf[i + 1] & 0xc0) !== 0x80 ||
(buf[i] & 0xfe) === 0xc0 // overlong
) {
return false;
}
i += 2;
} else if ((buf[i] & 0xf0) === 0xe0) { // 1110xxxx 10xxxxxx 10xxxxxx
if (
i + 2 >= len ||
(buf[i + 1] & 0xc0) !== 0x80 ||
(buf[i + 2] & 0xc0) !== 0x80 ||
buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80 || // overlong
buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0 // surrogate (U+D800 - U+DFFF)
) {
return false;
}
i += 3;
} else if ((buf[i] & 0xf8) === 0xf0) { // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
if (
i + 3 >= len ||
(buf[i + 1] & 0xc0) !== 0x80 ||
(buf[i + 2] & 0xc0) !== 0x80 ||
(buf[i + 3] & 0xc0) !== 0x80 ||
buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80 || // overlong
buf[i] === 0xf4 && buf[i + 1] > 0x8f || buf[i] > 0xf4 // > U+10FFFF
) {
return false;
}
i += 4;
} else {
return false;
}
}
return true;
}
module.exports = isValidUTF8;

View File

@@ -1,7 +0,0 @@
'use strict';
try {
module.exports = require('node-gyp-build')(__dirname);
} catch (e) {
module.exports = require('./fallback');
}

View File

@@ -1,36 +0,0 @@
{
"name": "utf-8-validate",
"version": "5.0.10",
"description": "Check if a buffer contains valid UTF-8",
"main": "index.js",
"engines": {
"node": ">=6.14.2"
},
"scripts": {
"install": "node-gyp-build",
"prebuild": "prebuildify --napi --strip --target=14.0.0",
"prebuild-darwin-x64+arm64": "prebuildify --arch x64+arm64 --napi --strip --target=14.0.0",
"test": "mocha"
},
"repository": {
"type": "git",
"url": "https://github.com/websockets/utf-8-validate"
},
"keywords": [
"utf-8-validate"
],
"author": "Einar Otto Stangvik <einaros@gmail.com> (http://2x.io)",
"license": "MIT",
"bugs": {
"url": "https://github.com/websockets/utf-8-validate/issues"
},
"homepage": "https://github.com/websockets/utf-8-validate",
"dependencies": {
"node-gyp-build": "^4.3.0"
},
"devDependencies": {
"mocha": "^10.0.0",
"node-gyp": "^9.1.0",
"prebuildify": "^5.0.0"
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,109 +0,0 @@
#define NAPI_VERSION 1
#include <assert.h>
#include <string.h>
#include <node_api.h>
napi_value IsValidUTF8(napi_env env, napi_callback_info info) {
napi_status status;
size_t argc = 1;
napi_value argv[1];
status = napi_get_cb_info(env, info, &argc, argv, NULL, NULL);
assert(status == napi_ok);
uint8_t *buf;
size_t len;
status = napi_get_buffer_info(env, argv[0], (void **)&buf, &len);
assert(status == napi_ok);
size_t i = 0;
//
// This code has been taken from utf8_check.c which was developed by
// Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/>.
//
// For original code / licensing please refer to
// https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c
//
while (i < len) {
size_t j = i + 8;
if (j <= len) {
//
// Read 8 bytes and check if they are ASCII.
//
uint64_t chunk;
memcpy(&chunk, buf + i, 8);
if ((chunk & 0x8080808080808080) == 0x00) {
i = j;
continue;
}
}
while ((buf[i] & 0x80) == 0x00) { // 0xxxxxxx
if (++i == len) {
goto exit;
}
}
if ((buf[i] & 0xe0) == 0xc0) { // 110xxxxx 10xxxxxx
if (
i + 1 == len ||
(buf[i + 1] & 0xc0) != 0x80 ||
(buf[i] & 0xfe) == 0xc0 // overlong
) {
break;
}
i += 2;
} else if ((buf[i] & 0xf0) == 0xe0) { // 1110xxxx 10xxxxxx 10xxxxxx
if (
i + 2 >= len ||
(buf[i + 1] & 0xc0) != 0x80 ||
(buf[i + 2] & 0xc0) != 0x80 ||
(buf[i] == 0xe0 && (buf[i + 1] & 0xe0) == 0x80) || // overlong
(buf[i] == 0xed && (buf[i + 1] & 0xe0) == 0xa0) // surrogate (U+D800 - U+DFFF)
) {
break;
}
i += 3;
} else if ((buf[i] & 0xf8) == 0xf0) { // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
if (
i + 3 >= len ||
(buf[i + 1] & 0xc0) != 0x80 ||
(buf[i + 2] & 0xc0) != 0x80 ||
(buf[i + 3] & 0xc0) != 0x80 ||
(buf[i] == 0xf0 && (buf[i + 1] & 0xf0) == 0x80) || // overlong
(buf[i] == 0xf4 && buf[i + 1] > 0x8f) || buf[i] > 0xf4 // > U+10FFFF
) {
break;
}
i += 4;
} else {
break;
}
}
exit:;
napi_value result;
status = napi_get_boolean(env, i == len, &result);
assert(status == napi_ok);
return result;
}
napi_value Init(napi_env env, napi_value exports) {
napi_status status;
napi_value isValidUTF8;
status = napi_create_function(env, NULL, 0, IsValidUTF8, NULL, &isValidUTF8);
assert(status == napi_ok);
return isValidUTF8;
}
NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)

66
package-lock.json generated
View File

@@ -8,41 +8,45 @@
"name": "screeps-deploy-action", "name": "screeps-deploy-action",
"version": "0.1.1", "version": "0.1.1",
"dependencies": { "dependencies": {
"@actions/core": "^1.11.1", "@actions/core": "^2.0.0",
"glob": "^11.0.1", "glob": "^11.0.1",
"screeps-api": "^1.7.2" "screeps-api": "^1.7.2"
} }
}, },
"node_modules/@actions/core": { "node_modules/@actions/core": {
"version": "1.11.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", "resolved": "https://registry.npmjs.org/@actions/core/-/core-2.0.1.tgz",
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", "integrity": "sha512-oBfqT3GwkvLlo1fjvhQLQxuwZCGTarTE5OuZ2Wg10hvhBj7LRIlF611WT4aZS6fDhO5ZKlY7lCAZTlpmyaHaeg==",
"license": "MIT",
"dependencies": { "dependencies": {
"@actions/exec": "^1.1.1", "@actions/exec": "^2.0.0",
"@actions/http-client": "^2.0.1" "@actions/http-client": "^3.0.0"
} }
}, },
"node_modules/@actions/exec": { "node_modules/@actions/exec": {
"version": "1.1.1", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-2.0.0.tgz",
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", "integrity": "sha512-k8ngrX2voJ/RIN6r9xB82NVqKpnMRtxDoiO+g3olkIUpQNqjArXrCQceduQZCQj3P3xm32pChRLqRrtXTlqhIw==",
"license": "MIT",
"dependencies": { "dependencies": {
"@actions/io": "^1.0.1" "@actions/io": "^2.0.0"
} }
}, },
"node_modules/@actions/http-client": { "node_modules/@actions/http-client": {
"version": "2.2.3", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-3.0.0.tgz",
"integrity": "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==", "integrity": "sha512-1s3tXAfVMSz9a4ZEBkXXRQD4QhY3+GAsWSbaYpeknPOKEeyRiU3lH+bHiLMZdo2x/fIeQ/hscL1wCkDLVM2DZQ==",
"license": "MIT",
"dependencies": { "dependencies": {
"tunnel": "^0.0.6", "tunnel": "^0.0.6",
"undici": "^5.25.4" "undici": "^5.28.5"
} }
}, },
"node_modules/@actions/io": { "node_modules/@actions/io": {
"version": "1.1.3", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", "resolved": "https://registry.npmjs.org/@actions/io/-/io-2.0.0.tgz",
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==" "integrity": "sha512-Jv33IN09XLO+0HS79aaODsvIRyduiF7NY/F6LYeK5oeUmrsz7aFdRphQjFoESF4jS7lMauDOttKALcpapVDIAg==",
"license": "MIT"
}, },
"node_modules/@fastify/busboy": { "node_modules/@fastify/busboy": {
"version": "2.1.1", "version": "2.1.1",
@@ -141,20 +145,6 @@
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
}, },
"node_modules/bufferutil": {
"version": "4.0.9",
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.9.tgz",
"integrity": "sha512-WDtdLmJvAuNNPzByAYpRo2rF1Mmradw6gvWsQKf63476DDXmomT9zUiGypLcG4ibIM67vhAj8jJRdbmEws2Aqw==",
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"dependencies": {
"node-gyp-build": "^4.3.0"
},
"engines": {
"node": ">=6.14.2"
}
},
"node_modules/call-bind-apply-helpers": { "node_modules/call-bind-apply-helpers": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
@@ -828,20 +818,6 @@
"node": ">=14.0" "node": ">=14.0"
} }
}, },
"node_modules/utf-8-validate": {
"version": "5.0.10",
"resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz",
"integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==",
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"dependencies": {
"node-gyp-build": "^4.3.0"
},
"engines": {
"node": ">=6.14.2"
}
},
"node_modules/which": { "node_modules/which": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",

View File

@@ -7,7 +7,7 @@
"start": "node index.js" "start": "node index.js"
}, },
"dependencies": { "dependencies": {
"@actions/core": "^1.11.1", "@actions/core": "^2.0.0",
"glob": "^11.0.1", "glob": "^11.0.1",
"screeps-api": "^1.7.2" "screeps-api": "^1.7.2"
} }