diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 2cfc8827e..b43f4e766 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -8,9 +8,10 @@ jobs: - id: output-set uses: actions/github-script@master with: - script: return 'test' + script: return core.getInput('input-value') result-encoding: string + input-value: output - run: | - if [[ "${{steps.output-set.outputs.result}}" != "test" ]]; then + if [[ "${{steps.output-set.outputs.result}}" != "output" ]]; then exit 1 fi diff --git a/README.md b/README.md index cd5c617e7..5b94ec5a6 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ be provided: [octokit/rest.js](https://github.com/octokit/rest.js) client - `context` An object containing the [context of the workflow run](https://github.com/actions/toolkit/tree/master/packages/github) +- `core` A reference to the [@actions/core](https://github.com/actions/toolkit/tree/master/packages/core) package Since the `script` is just a function body, these values will already be defined, so you don't have to (see examples below). diff --git a/dist/index.js b/dist/index.js index 68a5dc52c..5d7c55b64 100644 --- a/dist/index.js +++ b/dist/index.js @@ -9178,7 +9178,7 @@ async function main() { const github = new lib_github.GitHub(token, opts); const script = Object(core.getInput)('script', { required: true }); // Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors. - const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context }, script); + const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context, core: core }, script); let encoding = Object(core.getInput)('result-encoding'); encoding = encoding ? encoding : 'json'; let output; diff --git a/src/main.ts b/src/main.ts index 89bf9e4fe..00e95a1fe 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,7 +19,7 @@ async function main() { // Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors. const result = await callAsyncFunction( - {require: require, github, context}, + {require: require, github, context, core}, script )