Skip to content

Commit 584e5de

Browse files
committed
Access github.workspace via inputs
1 parent 1701f7e commit 584e5de

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

action.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ inputs:
3434
description: 'If true, only check if the test scripts are valid and skip test execution'
3535
default: "false"
3636
required: false
37+
github-workspace:
38+
description: 'The path to the GitHub workspace'
39+
default: ${{ github.workspace }}
40+
required: false
3741

3842
runs:
3943
using: node20

dist/index.js

+26-2
Original file line numberDiff line numberDiff line change
@@ -34713,13 +34713,37 @@ exports.parseK6Output = parseK6Output;
3471334713
/***/ }),
3471434714

3471534715
/***/ 1034:
34716-
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
34716+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
3471734717

3471834718
"use strict";
3471934719

34720+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
34721+
if (k2 === undefined) k2 = k;
34722+
var desc = Object.getOwnPropertyDescriptor(m, k);
34723+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
34724+
desc = { enumerable: true, get: function() { return m[k]; } };
34725+
}
34726+
Object.defineProperty(o, k2, desc);
34727+
}) : (function(o, m, k, k2) {
34728+
if (k2 === undefined) k2 = k;
34729+
o[k2] = m[k];
34730+
}));
34731+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
34732+
Object.defineProperty(o, "default", { enumerable: true, value: v });
34733+
}) : function(o, v) {
34734+
o["default"] = v;
34735+
});
34736+
var __importStar = (this && this.__importStar) || function (mod) {
34737+
if (mod && mod.__esModule) return mod;
34738+
var result = {};
34739+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
34740+
__setModuleDefault(result, mod);
34741+
return result;
34742+
};
3472034743
Object.defineProperty(exports, "__esModule", ({ value: true }));
3472134744
exports.cleanScriptPath = exports.validateTestPaths = void 0;
3472234745
// Common helper functions used in the action
34746+
const core = __importStar(__nccwpck_require__(2186));
3472334747
const child_process_1 = __nccwpck_require__(2081);
3472434748
async function validateTestPaths(testPaths) {
3472534749
/**
@@ -34764,7 +34788,7 @@ function cleanScriptPath(scriptPath) {
3476434788
* @return {string} - Cleaned script path
3476534789
*
3476634790
* */
34767-
const baseDir = process.env['GITHUB_WORKSPACE'] || '';
34791+
const baseDir = core.getInput('github-workspace', { required: false }) || '';
3476834792
const cleanedScriptPath = scriptPath.replace(baseDir, '');
3476934793
return scriptPath.trim();
3477034794
}

src/k6helper.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Common helper functions used in the action
2+
import * as core from '@actions/core';
23
import { spawn } from 'child_process';
34

45
export async function validateTestPaths(testPaths: string[]): Promise<string[]> {
@@ -55,7 +56,7 @@ export function cleanScriptPath(scriptPath: string): string {
5556
* @return {string} - Cleaned script path
5657
*
5758
* */
58-
const baseDir = process.env['GITHUB_WORKSPACE'] || '';
59+
const baseDir = core.getInput('github-workspace', { required: false }) || '';
5960
const cleanedScriptPath = scriptPath.replace(baseDir, '');
6061

6162
return scriptPath.trim();

0 commit comments

Comments
 (0)