Compare commits

...
4 Commits
Author SHA1 Message Date
Jonathan Clem c7971c2fc0 1.1.0 2020-05-20 09:53:04 -04:00
Jonathan Clem 7ec2818723 Merge pull request #52 from jasonmacgowan/feature/include-io
Include @actions/io
2020-05-20 09:50:23 -04:00
Jonathan Clem 287e10e610 Remove contributor home directory path from build artifacts 2020-05-20 09:47:59 -04:00
Jason Macgowan b2c461f3a2 Include @actions/io 2020-05-18 15:56:00 -04:00
6 changed files with 518 additions and 5 deletions
+1
View File
@@ -12,6 +12,7 @@ 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).
+504 -1
View File
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -1,6 +1,6 @@
{
"name": "github-script",
"version": "1.0.0",
"version": "1.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -27,6 +27,11 @@
"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",
+3 -2
View File
@@ -1,7 +1,7 @@
{
"name": "github-script",
"description": "A GitHub action for executing a simple script",
"version": "1.0.0",
"version": "1.1.0",
"author": "GitHub",
"license": "MIT",
"main": "dist/index.js",
@@ -36,7 +36,8 @@
},
"dependencies": {
"@actions/core": "^1.2.4",
"@actions/github": "^2.2.0"
"@actions/github": "^2.2.0",
"@actions/io": "^1.0.2"
},
"devDependencies": {
"@types/jest": "^25.1.4",
+2
View File
@@ -1,6 +1,7 @@
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
@@ -8,6 +9,7 @@ type AsyncFunctionArguments = {
context: Context
core: typeof core
github: GitHub
io: typeof io
require: NodeRequire
}
+2 -1
View File
@@ -1,5 +1,6 @@
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)
@@ -27,7 +28,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},
{require: require, github, context, core, io},
script
)