diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf87d15..c86d3c9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,6 @@ name: Validate action on: + push: pull_request: schedule: - cron: 0 0 * * * diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml deleted file mode 100644 index df8679d..0000000 --- a/.github/workflows/workflow.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Build action -on: [pull_request] - -jobs: - Build: - runs-on: macos-latest - steps: - - name: Checkout - uses: actions/checkout@master - - - name: Set Node.JS - uses: actions/setup-node@master - with: - node-version: 12.x - - - name: npm install - run: npm install - - - name: Build - run: npm run build diff --git a/.gitignore b/.gitignore index 140d803..14749c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -node_modules/ -lib \ No newline at end of file +# Visual Studio 2015/2017 cache/options directory +.vs/ \ No newline at end of file diff --git a/README.md b/README.md index e35a462..4651654 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This action is intended to configure Pagefile size and location for Windows imag |----------|-------------|--------|---------------| | `minimum-size` | Set minimum size of Pagefile | `2048MB`, `4GB`, `8GB` and etc | `8GB` | | `maximum-size` | Set maximum size of Pagefile | The same like `minimum-size` | `minimum-size` | -| `disk-root` | Set disk root where Pagefile will be located | `C:` or `D:` | `D:` | +| `disk-root` | Set disk root where Pagefile will be located | `C:` or `D:` | `Workspace root` | # Usage ``` diff --git a/action.yml b/action.yml index 538d7b8..cc79591 100644 --- a/action.yml +++ b/action.yml @@ -12,10 +12,45 @@ inputs: disk-root: description: 'Set disk root where pagefile.sys will be located' required: false - default: 'D:' runs: - using: 'node12' - main: 'dist/index.js' + using: 'composite' + steps: + - name: Configure Pagefile + id: configure-pagefile + shell: pwsh + run: | + if ( $PSVersionTable.Platform -ne 'Win32NT') { + throw "This task is intended only for Windows platform. It can't be run on $($PSVersionTable.Platform) platform" + } + + [System.UInt64] $MinimumSize = ($env:MinimumSize / 1kb) * 1kb + if ($MinimumSize -le 0) { + $MinimumSize = 8gb + } + + [System.UInt64] $MaximumSize = ($env:MaximumSize / 1kb) * 1kb + if ($MaximumSize -le 0) { + $MaximumSize = $MinimumSize + } + + [System.String] $DiskRoot = $env:DiskRoot + if ( [System.String]::IsNullOrWhiteSpace($DiskRoot) ) { + $DiskRoot = [System.IO.Path]::GetPathRoot($env:WorkSpace).TrimEnd([System.IO.Path]::DirectorySeparatorChar) + } + + echo "Pagefile configuration:" + echo "- Minimum size: $($MinimumSize)" + echo "- Maximum size: $($MaximumSize)" + echo "- Disk root: $($DiskRoot)" + + Add-Type -Path "$env:SourcePath" + [Util.PageFile]::SetPageFileSize($MinimumSize, $MaximumSize, $DiskRoot) + env: + MinimumSize: ${{ inputs.minimum-size }} + MaximumSize: ${{ inputs.maximum-size }} + DiskRoot: ${{ inputs.disk-root }} + SourcePath: ${{ github.action_path }}/src/SetPageFileSize.cs + WorkSpace: ${{ github.workspace }} branding: icon: 'cpu' color: 'purple' \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 77bfa46..0000000 --- a/dist/index.js +++ /dev/null @@ -1,454 +0,0 @@ -module.exports = -/******/ (function(modules, runtime) { // webpackBootstrap -/******/ "use strict"; -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ __webpack_require__.ab = __dirname + "/"; -/******/ -/******/ // the startup function -/******/ function startup() { -/******/ // Load entry module and return exports -/******/ return __webpack_require__(465); -/******/ }; -/******/ -/******/ // run startup -/******/ return startup(); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ 87: -/***/ (function(module) { - -module.exports = require("os"); - -/***/ }), - -/***/ 129: -/***/ (function(module) { - -module.exports = require("child_process"); - -/***/ }), - -/***/ 431: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const os = __importStar(__webpack_require__(87)); -/** - * Commands - * - * Command Format: - * ::name key=value,key=value::message - * - * Examples: - * ::warning::This is the message - * ::set-env name=MY_VAR::some value - */ -function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os.EOL); -} -exports.issueCommand = issueCommand; -function issue(name, message = '') { - issueCommand(name, {}, message); -} -exports.issue = issue; -const CMD_STRING = '::'; -class Command { - constructor(command, properties, message) { - if (!command) { - command = 'missing.command'; - } - this.command = command; - this.properties = properties; - this.message = message; - } - toString() { - let cmdStr = CMD_STRING + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += ' '; - let first = true; - for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - const val = this.properties[key]; - if (val) { - if (first) { - first = false; - } - else { - cmdStr += ','; - } - cmdStr += `${key}=${escapeProperty(val)}`; - } - } - } - } - cmdStr += `${CMD_STRING}${escapeData(this.message)}`; - return cmdStr; - } -} -/** - * Sanitizes an input into a string so it can be passed into issueCommand safely - * @param input input to sanitize into a string - */ -function toCommandValue(input) { - if (input === null || input === undefined) { - return ''; - } - else if (typeof input === 'string' || input instanceof String) { - return input; - } - return JSON.stringify(input); -} -exports.toCommandValue = toCommandValue; -function escapeData(s) { - return toCommandValue(s) - .replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A'); -} -function escapeProperty(s) { - return toCommandValue(s) - .replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A') - .replace(/:/g, '%3A') - .replace(/,/g, '%2C'); -} -//# sourceMappingURL=command.js.map - -/***/ }), - -/***/ 465: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = __importStar(__webpack_require__(622)); -const child = __importStar(__webpack_require__(129)); -const core = __importStar(__webpack_require__(470)); -const run = () => { - try { - if (process.platform !== "win32") { - throw new Error(`This task is intended only for Windows platform. It can't be run on '${process.platform}' platform`); - } - const minimumSize = core.getInput("minimum-size", { required: true }); - const maximumSize = core.getInput("maximum-size", { required: false }) || minimumSize; - const diskRoot = core.getInput("disk-root", { required: true }); - core.info("Pagefile configuration:"); - core.info(`- Minimum size: ${minimumSize}`); - core.info(`- Maximum size: ${maximumSize}`); - core.info(`- Disk root: ${diskRoot}`); - const scriptPath = path.resolve(__dirname, "..", "scripts", "SetPageFileSize.ps1"); - const scriptArguments = [ - "-MinimumSize", minimumSize, - "-MaximumSize", maximumSize, - "-DiskRoot", diskRoot - ]; - core.debug("Invoke configuration script:"); - core.debug(`Script path: ${scriptPath}`); - core.debug(`Script arguments: ${scriptArguments}`); - const scriptResult = child.spawnSync("powershell", [scriptPath, ...scriptArguments], { - timeout: 60 * 1000 - }); - if (scriptResult.stdout) { - core.info(scriptResult.stdout.toString()); - } - if (scriptResult.stderr) { - core.error(scriptResult.stderr.toString()); - } - if (scriptResult.status !== 0) { - throw new Error(`Script has finished with exit code '${scriptResult.status}'`); - } - } - catch (error) { - core.setFailed(error.message); - } -}; -run(); - - -/***/ }), - -/***/ 470: -/***/ (function(__unusedmodule, exports, __webpack_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const command_1 = __webpack_require__(431); -const os = __importStar(__webpack_require__(87)); -const path = __importStar(__webpack_require__(622)); -/** - * The code to exit an action - */ -var ExitCode; -(function (ExitCode) { - /** - * A code indicating that the action was successful - */ - ExitCode[ExitCode["Success"] = 0] = "Success"; - /** - * A code indicating that the action was a failure - */ - ExitCode[ExitCode["Failure"] = 1] = "Failure"; -})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); -//----------------------------------------------------------------------- -// Variables -//----------------------------------------------------------------------- -/** - * Sets env variable for this action and future actions in the job - * @param name the name of the variable to set - * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function exportVariable(name, val) { - const convertedVal = command_1.toCommandValue(val); - process.env[name] = convertedVal; - command_1.issueCommand('set-env', { name }, convertedVal); -} -exports.exportVariable = exportVariable; -/** - * Registers a secret which will get masked from logs - * @param secret value of the secret - */ -function setSecret(secret) { - command_1.issueCommand('add-mask', {}, secret); -} -exports.setSecret = setSecret; -/** - * Prepends inputPath to the PATH (for this action and future actions) - * @param inputPath - */ -function addPath(inputPath) { - command_1.issueCommand('add-path', {}, inputPath); - process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; -} -exports.addPath = addPath; -/** - * Gets the value of an input. The value is also trimmed. - * - * @param name name of the input to get - * @param options optional. See InputOptions. - * @returns string - */ -function getInput(name, options) { - const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; - if (options && options.required && !val) { - throw new Error(`Input required and not supplied: ${name}`); - } - return val.trim(); -} -exports.getInput = getInput; -/** - * Sets the value of an output. - * - * @param name name of the output to set - * @param value value to store. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function setOutput(name, value) { - command_1.issueCommand('set-output', { name }, value); -} -exports.setOutput = setOutput; -/** - * 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. - * - */ -function setCommandEcho(enabled) { - command_1.issue('echo', enabled ? 'on' : 'off'); -} -exports.setCommandEcho = setCommandEcho; -//----------------------------------------------------------------------- -// Results -//----------------------------------------------------------------------- -/** - * Sets the action status to failed. - * When the action exits it will be with an exit code of 1 - * @param message add error issue message - */ -function setFailed(message) { - process.exitCode = ExitCode.Failure; - error(message); -} -exports.setFailed = setFailed; -//----------------------------------------------------------------------- -// Logging Commands -//----------------------------------------------------------------------- -/** - * Gets whether Actions Step Debug is on or not - */ -function isDebug() { - return process.env['RUNNER_DEBUG'] === '1'; -} -exports.isDebug = isDebug; -/** - * Writes debug message to user log - * @param message debug message - */ -function debug(message) { - command_1.issueCommand('debug', {}, message); -} -exports.debug = debug; -/** - * Adds an error issue - * @param message error issue message. Errors will be converted to string via toString() - */ -function error(message) { - command_1.issue('error', message instanceof Error ? message.toString() : message); -} -exports.error = error; -/** - * Adds an warning issue - * @param message warning issue message. Errors will be converted to string via toString() - */ -function warning(message) { - command_1.issue('warning', message instanceof Error ? message.toString() : message); -} -exports.warning = warning; -/** - * Writes info to log with console.log. - * @param message info message - */ -function info(message) { - process.stdout.write(message + os.EOL); -} -exports.info = info; -/** - * Begin an output group. - * - * Output until the next `groupEnd` will be foldable in this group - * - * @param name The name of the output group - */ -function startGroup(name) { - command_1.issue('group', name); -} -exports.startGroup = startGroup; -/** - * End an output group. - */ -function endGroup() { - command_1.issue('endgroup'); -} -exports.endGroup = endGroup; -/** - * Wrap an asynchronous function call in a group. - * - * Returns the same type as the function itself. - * - * @param name The name of the group - * @param fn The function to wrap in the group - */ -function group(name, fn) { - return __awaiter(this, void 0, void 0, function* () { - startGroup(name); - let result; - try { - result = yield fn(); - } - finally { - endGroup(); - } - return result; - }); -} -exports.group = group; -//----------------------------------------------------------------------- -// Wrapper action state -//----------------------------------------------------------------------- -/** - * Saves state for current action, the state can only be retrieved by this action's post job execution. - * - * @param name name of the state to store - * @param value value to store. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function saveState(name, value) { - command_1.issueCommand('save-state', { name }, value); -} -exports.saveState = saveState; -/** - * Gets the value of an state set by this action's main execution. - * - * @param name name of the state to get - * @returns string - */ -function getState(name) { - return process.env[`STATE_${name}`] || ''; -} -exports.getState = getState; -//# sourceMappingURL=core.js.map - -/***/ }), - -/***/ 622: -/***/ (function(module) { - -module.exports = require("path"); - -/***/ }) - -/******/ }); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index dbf2c94..0000000 --- a/package-lock.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "configure-pagefile-action", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@actions/core": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.4.tgz", - "integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg==" - }, - "@types/node": { - "version": "12.12.37", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.37.tgz", - "integrity": "sha512-4mXKoDptrXAwZErQHrLzpe0FN/0Wmf5JRniSVIdwUrtDf9wnmEV1teCNLBo/TwuXhkK/bVegoEn/wmb+x0AuPg==", - "dev": true - }, - "@zeit/ncc": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.21.1.tgz", - "integrity": "sha512-M9WzgquSOt2nsjRkYM9LRylBLmmlwNCwYbm3Up3PDEshfvdmIfqpFNSK8EJvR18NwZjGHE5z2avlDtYQx2JQnw==", - "dev": true - }, - "typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", - "dev": true - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index ad44415..0000000 --- a/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "configure-pagefile-action", - "version": "1.0.0", - "private": true, - "description": "Configure Pagefile on Windows agents in GitHub Actions", - "main": "lib/configure-pagefile.js", - "scripts": { - "build": "tsc && ncc build" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/al-cheb/configure-pagefile-action.git" - }, - "keywords": [ - "actions", - "pagefile", - "configure", - "windows" - ], - "author": "Aleksandr Chebotov & Maxim Lobanov", - "license": "MIT", - "dependencies": { - "@actions/core": "^1.2.3" - }, - "devDependencies": { - "@types/node": "^12.0.4", - "@zeit/ncc": "^0.21.1", - "typescript": "^3.8.3" - } -} diff --git a/scripts/SetPageFileSize.ps1 b/src/SetPageFileSize.cs similarity index 82% rename from scripts/SetPageFileSize.ps1 rename to src/SetPageFileSize.cs index 8407efd..11091f7 100644 --- a/scripts/SetPageFileSize.ps1 +++ b/src/SetPageFileSize.cs @@ -1,25 +1,9 @@ -<# -.SYNOPSIS - Configure Pagefile on Windows machine -.NOTES - Author: Aleksandr Chebotov -.EXAMPLE - SetPageFileSize.ps1 -MinimumSize 4GB -MaximumSize 8GB -DiskRoot "D:" -#> - -param( - [System.UInt64] $MinimumSize = 8gb , - [System.UInt64] $MaximumSize = 8gb , - [System.String] $DiskRoot = "D:" -) - -# https://referencesource.microsoft.com/#System.IdentityModel/System/IdentityModel/NativeMethods.cs,619688d876febbe1 -# https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/mm/modwrite/create.htm -# https://referencesource.microsoft.com/#mscorlib/microsoft/win32/safehandles/safefilehandle.cs,9b08210f3be75520 -# https://referencesource.microsoft.com/#mscorlib/system/security/principal/tokenaccesslevels.cs,6eda91f498a38586 -# https://www.autoitscript.com/forum/topic/117993-api-ntcreatepagingfile/ - -$source = @' +// https://referencesource.microsoft.com/#System.IdentityModel/System/IdentityModel/NativeMethods.cs,619688d876febbe1 +// https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/mm/modwrite/create.htm +// https://referencesource.microsoft.com/#mscorlib/microsoft/win32/safehandles/safefilehandle.cs,9b08210f3be75520 +// https://referencesource.microsoft.com/#mscorlib/system/security/principal/tokenaccesslevels.cs,6eda91f498a38586 +// https://www.autoitscript.com/forum/topic/117993-api-ntcreatepagingfile/ + using System; using System.ComponentModel; using System.Diagnostics; @@ -39,20 +23,20 @@ internal struct LUID internal uint LowPart; internal uint HighPart; } - + [StructLayout(LayoutKind.Sequential)] internal struct LUID_AND_ATTRIBUTES { internal LUID Luid; internal uint Attributes; } - + [StructLayout(LayoutKind.Sequential)] internal struct TOKEN_PRIVILEGE { internal uint PrivilegeCount; internal LUID_AND_ATTRIBUTES Privilege; - + internal static readonly uint Size = (uint)Marshal.SizeOf(typeof(TOKEN_PRIVILEGE)); } @@ -93,9 +77,9 @@ [Out] out SafeCloseHandle tokenHandle [DllImport("ntdll.dll", CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)] internal static extern Int32 NtCreatePagingFile( - [In] ref UNICODE_STRING pageFileName, - [In] ref Int64 minimumSize, - [In] ref Int64 maximumSize, + [In] ref UNICODE_STRING pageFileName, + [In] ref Int64 minimumSize, + [In] ref Int64 maximumSize, [In] UInt32 flags ); @@ -107,7 +91,7 @@ int ucchMax ); } - public sealed class SafeCloseHandle: SafeHandleZeroOrMinusOneIsInvalid + public sealed class SafeCloseHandle: SafeHandleZeroOrMinusOneIsInvalid { [DllImport("kernel32.dll", ExactSpelling = true, SetLastError = true)] internal extern static bool CloseHandle(IntPtr handle); @@ -115,8 +99,8 @@ public sealed class SafeCloseHandle: SafeHandleZeroOrMinusOneIsInvalid private SafeCloseHandle() : base(true) { } - - public SafeCloseHandle(IntPtr preexistingHandle, bool ownsHandle) : base(ownsHandle) + + public SafeCloseHandle(IntPtr preexistingHandle, bool ownsHandle) : base(ownsHandle) { SetHandle(preexistingHandle); } @@ -184,10 +168,4 @@ out hToken NativeMethods.AdjustTokenPrivileges(hToken, false, ref newState, NativeMethods.TOKEN_PRIVILEGE.Size, out previousState, out previousSize); } } -} -'@ - -Add-Type -TypeDefinition $source - -# Set SetPageFileSize -[Util.PageFile]::SetPageFileSize($minimumSize, $maximumSize, $diskRoot) \ No newline at end of file +} \ No newline at end of file diff --git a/src/configure-pagefile.ts b/src/configure-pagefile.ts deleted file mode 100644 index 01599b3..0000000 --- a/src/configure-pagefile.ts +++ /dev/null @@ -1,41 +0,0 @@ -import * as path from "path"; -import * as child from "child_process"; -import * as core from "@actions/core"; - -const run = (): void => { - try { - if (process.platform !== "win32") { - throw new Error(`This task is intended only for Windows platform. It can't be run on '${process.platform}' platform`); - } - - const minimumSize = core.getInput("minimum-size", { required: true }); - const maximumSize = core.getInput("maximum-size", { required: false }) || minimumSize; - const diskRoot = core.getInput("disk-root", { required: true }); - - core.info("Pagefile configuration:"); - core.info(`- Minimum size: ${minimumSize}`); - core.info(`- Maximum size: ${maximumSize}`); - core.info(`- Disk root: ${diskRoot}`); - - const scriptPath = path.resolve(__dirname, "..", "scripts", "SetPageFileSize.ps1"); - const scriptArguments = [ - "-MinimumSize", minimumSize, - "-MaximumSize", maximumSize, - "-DiskRoot", diskRoot - ]; - core.debug("Invoke configuration script:"); - core.debug(`Script path: ${scriptPath}`); - core.debug(`Script arguments: ${scriptArguments}`); - - const scriptResult = child.spawnSync("powershell", [scriptPath, ...scriptArguments], { - timeout: 60 * 1000 - }); - if (scriptResult.stdout) { core.info(scriptResult.stdout.toString()); } - if (scriptResult.stderr) { core.error(scriptResult.stderr.toString()); } - if (scriptResult.status !== 0) { throw new Error(`Script has finished with exit code '${scriptResult.status}'`) } - } catch (error) { - core.setFailed(error.message); - } -}; - -run(); diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index f37f328..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2019", - "module": "commonjs", - "outDir": "./lib", - "rootDir": "./src", - "esModuleInterop": true, - - /* Strict Type-Checking Options */ - "strict": true, - "noImplicitAny": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - - /* Additional Checks */ - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true - }, - "include": ["./src/**/*.ts"], - "exclude": ["node_modules"] - } \ No newline at end of file