From c19d6ba8b3b42c5afb73605be706411abded775c Mon Sep 17 00:00:00 2001 From: Jochen Ulrich Date: Fri, 17 Jul 2020 00:47:14 +0200 Subject: [PATCH 1/3] Adds note that absolute path is required An absolute path is required when calling `require()` from within the github-script --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 007a154..aee2976 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,7 @@ jobs: const scriptPath = path.resolve('./path/to/script.js') console.log(require(scriptPath)({context})) ``` +_(Note that the script path given to `require()` must be an absolute path in this case.)_ And then export a function from your module: From 62c8044fd6ffdecb748518f34c50d610b540d658 Mon Sep 17 00:00:00 2001 From: Jonathan Clem Date: Fri, 17 Jul 2020 10:25:39 -0400 Subject: [PATCH 2/3] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aee2976..55c9db1 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,8 @@ jobs: const scriptPath = path.resolve('./path/to/script.js') console.log(require(scriptPath)({context})) ``` -_(Note that the script path given to `require()` must be an absolute path in this case.)_ + +*(Note that the script path given to `require()` must be an absolute path in this case, hence the call to `path.resolve()`.)* And then export a function from your module: From 603dfa3ce291affeb11d6e65371d17b4173efad4 Mon Sep 17 00:00:00 2001 From: Jonathan Clem Date: Fri, 17 Jul 2020 10:25:55 -0400 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 55c9db1..8e08984 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,7 @@ jobs: console.log(require(scriptPath)({context})) ``` -*(Note that the script path given to `require()` must be an absolute path in this case, hence the call to `path.resolve()`.)* +*Note that the script path given to `require()` must be an absolute path in this case, hence the call to `path.resolve()`.* And then export a function from your module: