8000 test · actions/github-script@ec5277f · GitHub
[go: up one dir, main page]

Skip to content

Commit ec5277f

Browse files
test
1 parent ced25c3 commit ec5277f

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

dist/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9301,11 +9301,15 @@ function callAsyncFunction(args, source) {
93019301
// EXTERNAL MODULE: external "fs"
93029302
var external_fs_ = __webpack_require__(747);
93039303

9304+
// EXTERNAL MODULE: external "path"
9305+
var external_path_ = __webpack_require__(622);
9306+
93049307
// CONCATENATED MODULE: ./src/main.ts
93059308

93069309

93079310

93089311

9312+
93099313
process.on('unhandledRejection', handleError);
93109314
main().catch(handleError);
93119315
async function main() {
@@ -9331,9 +9335,12 @@ async function main() {
93319335
Object(core.debug)(__dirname);
93329336
Object(core.debug)(__filename);
93339337
Object(core.debug)('-------');
9334-
if (Object(external_fs_.existsSync)(file)) {
9338+
// @ts-ignore
9339+
const filePath = Object(external_path_.join)(process.env.GITHUB_WORKSPACE, file);
9340+
Object(core.debug)(filePath);
9341+
if (Object(external_fs_.existsSync)(filePath)) {
93359342
Object(core.debug)('Inside try block');
9336-
script = Object(external_fs_.readFileSync)(file, 'utf-8');
9343+
script = Object(external_fs_.readFileSync)(filePath, 'utf-8');
93379344
}
93389345
Object(core.debug)(script);
93399346
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors.

src/main.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as core from '@actions/core'
22
import {context, GitHub} from '@actions/github'
33
import {callAsyncFunction} from './async-function'
44
import { existsSync, readFileSync } from 'fs'
5+
import { join } from 'path'
56

67
process.on('unhandledRejection', handleError)
78
main().catch(handleError)
@@ -29,9 +30,12 @@ async function main() {
2930
core.debug(__filename)
3031
core.debug('-------')
3132

32-
if(existsSync(file)){
33+
// @ts-ignore
34+
const filePath = join(process.env.GITHUB_WORKSPACE, file)
35+
core.debug(filePath)
36+
if(existsSync(filePath)){
3337
core.debug('Inside try block');
34-
script = readFileSync(file, 'utf-8')
38+
script = readFileSync(filePath, 'utf-8')
3539
}
3640

3741
core.debug(script);

0 commit comments

Comments
 (0)
0