Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c20b4a79d3 |
@@ -12,7 +12,6 @@ arguments will be provided:
|
||||
- `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
|
||||
- `io` A reference to the [@actions/io](https://github.com/actions/toolkit/tree/master/packages/io) package
|
||||
|
||||
Since the `script` is just a function body, these values will already be
|
||||
defined, so you don't have to (see examples below).
|
||||
|
||||
Vendored
+1
-504
File diff suppressed because it is too large
Load Diff
Generated
+1
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "github-script",
|
||||
"version": "1.1.0",
|
||||
"version": "1.0.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -27,11 +27,6 @@
|
||||
"tunnel": "0.0.6"
|
||||
}
|
||||
},
|
||||
"@actions/io": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.2.tgz",
|
||||
"integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg=="
|
||||
},
|
||||
"@babel/code-frame": {
|
||||
"version": "7.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
|
||||
|
||||
+2
-3
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "github-script",
|
||||
"description": "A GitHub action for executing a simple script",
|
||||
"version": "1.1.0",
|
||||
"version": "1.0.1",
|
||||
"author": "GitHub",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
@@ -36,8 +36,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.4",
|
||||
"@actions/github": "^2.2.0",
|
||||
"@actions/io": "^1.0.2"
|
||||
"@actions/github": "^2.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^25.1.4",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as core from '@actions/core'
|
||||
import {GitHub} from '@actions/github'
|
||||
import {Context} from '@actions/github/lib/context'
|
||||
import * as io from '@actions/io'
|
||||
|
||||
const AsyncFunction = Object.getPrototypeOf(async () => null).constructor
|
||||
|
||||
@@ -9,7 +8,6 @@ type AsyncFunctionArguments = {
|
||||
context: Context
|
||||
core: typeof core
|
||||
github: GitHub
|
||||
io: typeof io
|
||||
require: NodeRequire
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
import * as core from '@actions/core'
|
||||
import {context, GitHub} from '@actions/github'
|
||||
import * as io from '@actions/io'
|
||||
import {callAsyncFunction} from './async-function'
|
||||
|
||||
process.on('unhandledRejection', handleError)
|
||||
@@ -28,7 +27,7 @@ async function main(): Promise<void> {
|
||||
|
||||
// Using property/value shorthand on `require` (e.g. `{require}`) causes compilation errors.
|
||||
const result = await callAsyncFunction(
|
||||
{require: require, github, context, core, io},
|
||||
{require: require, github, context, core},
|
||||
script
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user