Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0d15461

Browse filesBrowse files
authored
Merge pull request #33 from actions/add-core
Add core to execution context
2 parents 80a5e94 + e4cc5a8 commit 0d15461
Copy full SHA for 0d15461

File tree

Expand file treeCollapse file tree

4 files changed

+6
-4
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+6
-4
lines changed

‎.github/workflows/integration.yml

Copy file name to clipboardExpand all lines: .github/workflows/integration.yml
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ jobs:
88
- id: output-set
99
uses: actions/github-script@master
1010
with:
11-
script: return 'test'
11+
script: return core.getInput('input-value')
1212
result-encoding: string
13+
input-value: output
1314
- run: |
14-
if [[ "${{steps.output-set.outputs.result}}" != "test" ]]; then
15+
if [[ "${{steps.output-set.outputs.result}}" != "output" ]]; then
1516
exit 1
1617
fi

‎README.md

Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ be provided:
1111
[octokit/rest.js](https://github.com/octokit/rest.js) client
1212
- `context` An object containing the [context of the workflow
1313
run](https://github.com/actions/toolkit/tree/master/packages/github)
14+
- `core` A reference to the [@actions/core](https://github.com/actions/toolkit/tree/master/packages/core) package
1415

1516
Since the `script` is just a function body, these values will already be
1617
defined, so you don't have to (see examples below).

‎dist/index.js

Copy file name to clipboardExpand all lines: dist/index.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9178,7 +9178,7 @@ async function main() {
91789178
const github = new lib_github.GitHub(token, opts);
91799179
const script = Object(core.getInput)('script', { required: true });
91809180
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors.
9181-
const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context }, script);
9181+
const result = await callAsyncFunction({ require: __webpack_require__(875), github, context: lib_github.context, core: core }, script);
91829182
let encoding = Object(core.getInput)('result-encoding');
91839183
encoding = encoding ? encoding : 'json';
91849184
let output;

‎src/main.ts

Copy file name to clipboardExpand all lines: src/main.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async function main() {
1919

2020
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilatin errors.
2121
const result = await callAsyncFunction(
22-
{require: require, github, context},
22+
{require: require, github, context, core},
2323
script
2424
)
2525

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.