s/script/module

This commit is contained in:
Jonathan Clem
2020-05-18 12:41:53 -04:00
parent 52110c52e9
commit d89db5b6f4

View File

@@ -147,7 +147,7 @@ contain the actual diff text.
### Run a separate file ### Run a separate file
If you don't want to inline your entire script that you want to run, you can If you don't want to inline your entire script that you want to run, you can
use a separate JavaScript file in your repository like so: use a separate JavaScript module in your repository like so:
```yaml ```yaml
on: push on: push
@@ -164,7 +164,7 @@ jobs:
console.log(require(scriptPath)({context})) console.log(require(scriptPath)({context}))
``` ```
And then export a function from your script: And then export a function from your module:
```javascript ```javascript
module.exports = ({context}) => { module.exports = ({context}) => {
@@ -177,7 +177,7 @@ the inline script.
Note that because you can't `require` things like the GitHub context or Note that because you can't `require` things like the GitHub context or
Actions Toolkit libraries, you'll want to pass them as arguments to your Actions Toolkit libraries, you'll want to pass them as arguments to your
external script. external function.
### Result encoding ### Result encoding