Skip to content
This repository was archived by the owner on Oct 13, 2020. It is now read-only.

Commit 63e5270

Browse files
committed
fix(build): fix runtime errors
patch runtime issue with navigator being included, this is not safe for use in node [ch8743]
1 parent fa05a7c commit 63e5270

File tree

7 files changed

+81
-56
lines changed

7 files changed

+81
-56
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ inputs:
1313
description: 'The actions title'
1414
runs:
1515
using: 'node12'
16-
main: 'index.js'
16+
main: 'lib/index.js'

lib/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require('./patch')
2+
3+
/* eslint-disable-next-line import/no-unresolved */
4+
require('../dist')

lib/patch.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
;(function patch() {
2+
global.navigator = {}
3+
})()

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"description": "GitHub action for creating annotations from JSON file",
6-
"main": "./index.js",
6+
"main": "dist/index.js",
77
"files": [
88
"dist"
99
],
@@ -47,7 +47,7 @@
4747
},
4848
"dependencies": {
4949
"@actions/core": "^1.2.2",
50-
"@actions/github": "^1.1.0",
50+
"@actions/github": "2.1.0",
5151
"@octokit/core": "^2.4.0",
5252
"@octokit/rest": "^16.43.1"
5353
},

rollup.config.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
const config = require('@attest/config-rollup-typescript')
2-
const { dependencies: dependenciesOptions } = require('./package.json')
2+
const { dependencies: packageDependencies } = require('./package.json')
33

4-
const dependencies = Object.keys(dependenciesOptions)
4+
const dependencies = Object.keys(packageDependencies)
55

6-
module.exports = config({
7-
builds(options) {
8-
return [
9-
{
10-
...options,
11-
output: 'dist/index.js',
12-
format: 'cjs',
13-
},
14-
]
15-
},
16-
}).map(configuration => {
17-
const { external = [] } = configuration
6+
module.exports = config().map(configuration => {
7+
const external = configuration.external.filter(dependency => !dependencies.includes(dependency))
188

19-
return {
20-
...configuration,
21-
external: external.filter(external => !dependencies.includes(external)),
22-
}
9+
return { ...configuration, external }
2310
})

src/github.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { Annotations } from '@/annotations'
22
import { Context } from '@actions/github/lib/context'
33
import { Octokit } from '@octokit/rest'
4-
import github from '@actions/github'
4+
5+
const github = require('@actions/github')
56

67
export class Github {
7-
private readonly client: github.GitHub
8+
private readonly client: Octokit
89
private readonly context: Context
910
private readonly owner: string
1011
private readonly repo: string

yarn.lock

Lines changed: 63 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,22 @@
77
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.2.2.tgz#3c4848d50378f9e3bcb67bcf97813382ec7369ee"
88
integrity sha512-IbCx7oefq+Gi6FWbSs2Fnw8VkEI6Y4gvjrYprY3RV//ksq/KPMlClOerJ4jRosyal6zkUIc8R9fS/cpRMlGClg==
99

10-
"@actions/github@^1.1.0":
11-
version "1.1.0"
12-
resolved "https://registry.yarnpkg.com/@actions/github/-/github-1.1.0.tgz#06f34e6b0cf07eb2b3641de3e680dbfae6bcd400"
13-
integrity sha512-cHf6PyoNMdei13jEdGPhKprIMFmjVVW/dnM5/9QmQDJ1ZTaGVyezUSCUIC/ySNLRvDUpeFwPYMdThSEJldSbUw==
10+
"@actions/github@2.1.0":
11+
version "2.1.0"
12+
resolved "https://registry.yarnpkg.com/@actions/github/-/github-2.1.0.tgz#ca36cfb146b4c8955f3d5f88d8dde5f89194de21"
13+
integrity sha512-G4ncMlh4pLLAvNgHUYUtpWQ1zPf/VYqmRH9oshxLabdaOOnp7i1hgSgzr2xne2YUaSND3uqemd3YYTIsm2f/KQ==
1414
dependencies:
15-
"@octokit/graphql" "^2.0.1"
15+
"@actions/http-client" "^1.0.3"
16+
"@octokit/graphql" "^4.3.1"
1617
"@octokit/rest" "^16.15.0"
1718

19+
"@actions/http-client@^1.0.3":
20+
version "1.0.6"
21+
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.6.tgz#6f9267ca50e1d74d8581f4a894a943cd4c97b49a"
22+
integrity sha512-LGmio4w98UyGX33b/W6V6Nx/sQHRXZ859YlMkn36wPsXPB82u8xTVlA/Dq2DXrm6lEq9RVmisRJa1c+HETAIJA==
23+
dependencies:
24+
tunnel "0.0.6"
25+
1826
"@attest/config-babel-preset-env-node@^0.1.19":
1927
version "0.1.19"
2028
resolved "https://npm.pkg.github.com/download/@attest/config-babel-preset-env-node/0.1.19/9a3b1eaabcd71dbcfc15fabc987167bf99d002e3fcc06e19febd3603f34337bf#f16a56c3e9e9a8fdf9549e65e3751898538e600a"
@@ -1325,14 +1333,6 @@
13251333
is-plain-object "^3.0.0"
13261334
universal-user-agent "^4.0.0"
13271335

1328-
"@octokit/graphql@^2.0.1":
1329-
version "2.1.3"
1330-
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-2.1.3.tgz#60c058a0ed5fa242eca6f938908d95fd1a2f4b92"
1331-
integrity sha512-XoXJqL2ondwdnMIW3wtqJWEwcBfKk37jO/rYkoxNPEVeLBDGsGO1TCWggrAlq3keGt/O+C/7VepXnukUxwt5vA==
1332-
dependencies:
1333-
"@octokit/request" "^5.0.0"
1334-
universal-user-agent "^2.0.3"
1335-
13361336
"@octokit/graphql@^4.3.1":
13371337
version "4.3.1"
13381338
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.3.1.tgz#9ee840e04ed2906c7d6763807632de84cdecf418"
@@ -1371,7 +1371,7 @@
13711371
deprecation "^2.0.0"
13721372
once "^1.4.0"
13731373

1374-
"@octokit/request@^5.0.0", "@octokit/request@^5.2.0", "@octokit/request@^5.3.0", "@octokit/request@^5.3.1":
1374+
"@octokit/request@^5.2.0", "@octokit/request@^5.3.0", "@octokit/request@^5.3.1":
13751375
version "5.3.1"
13761376
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.3.1.tgz#3a1ace45e6f88b1be4749c5da963b3a3b4a2f120"
13771377
integrity sha512-5/X0AL1ZgoU32fAepTfEoggFinO3rxsMLtzhlUX+RctLrusn/CApJuGFCd0v7GMFhF+8UiCsTTfsu7Fh1HnEJg==
@@ -1557,9 +1557,9 @@
15571557
read-pkg-up "^7.0.0"
15581558

15591559
"@sinonjs/commons@^1.7.0":
1560-
version "1.7.0"
1561-
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.7.0.tgz#f90ffc52a2e519f018b13b6c4da03cbff36ebed6"
1562-
integrity sha512-qbk9AP+cZUsKdW1GJsBpxPKFmCJ0T8swwzVje3qFd+AkQb74Q/tiuzrdfFg8AD2g5HH/XbE/I8Uc1KYHVYWfhg==
1560+
version "1.7.1"
1561+
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.7.1.tgz#da5fd19a5f71177a53778073978873964f49acf1"
1562+
integrity sha512-Debi3Baff1Qu1Unc3mjJ96MgpbwTn43S1+9yJ0llWygPwDNu2aaWBD6yc9y/Z8XDRNhx7U+u2UDg2OGQXkclUQ==
15631563
dependencies:
15641564
type-detect "4.0.8"
15651565

@@ -1671,9 +1671,9 @@
16711671
integrity sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=
16721672

16731673
"@types/node@*", "@types/node@>= 8":
1674-
version "13.7.1"
1675-
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.1.tgz#238eb34a66431b71d2aaddeaa7db166f25971a0d"
1676-
integrity sha512-Zq8gcQGmn4txQEJeiXo/KiLpon8TzAl0kmKH4zdWctPj05nWwp1ClMdAVEloqrQKfaC48PNLdgN/aVaLqUrluA==
1674+
version "13.7.2"
1675+
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.2.tgz#50375b95b5845a34efda2ffb3a087c7becbc46c6"
1676+
integrity sha512-uvilvAQbdJvnSBFcKJ2td4016urcGvsiR+N4dHGU87ml8O2Vl6l+ErOi9w0kXSPiwJ1AYlIW+0pDXDWWMOiWbw==
16771677

16781678
"@types/normalize-package-data@^2.4.0":
16791679
version "2.4.0"
@@ -3179,7 +3179,7 @@ debug@^3.1.0:
31793179
dependencies:
31803180
ms "^2.1.1"
31813181

3182-
debuglog@^1.0.1:
3182+
debuglog@*, debuglog@^1.0.1:
31833183
version "1.0.1"
31843184
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
31853185
integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=
@@ -3410,9 +3410,9 @@ editor@~1.0.0:
34103410
integrity sha1-YMf4e9YrzGqJT6jM1q+3gjok90I=
34113411

34123412
electron-to-chromium@^1.3.349:
3413-
version "1.3.354"
3414-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.354.tgz#6c6ad9ef63654c4c022269517c5a3095cebc94db"
3415-
integrity sha512-24YMkNiZWOUeF6YeoscWfIGP0oMx+lJpU/miwI+lcu7plIDpyZn8Gx0lx0qTDlzGoz7hx+lpyD8QkbkX5L2Pqw==
3413+
version "1.3.355"
3414+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.355.tgz#ff805ed8a3d68e550a45955134e4e81adf1122ba"
3415+
integrity sha512-zKO/wS+2ChI/jz9WAo647xSW8t2RmgRLFdbUb/77cORkUTargO+SCj4ctTHjBn2VeNFrsLgDT7IuDVrd3F8mLQ==
34163416

34173417
elegant-spinner@^1.0.1:
34183418
version "1.0.1"
@@ -4858,7 +4858,7 @@ import-modules@^2.0.0:
48584858
resolved "https://registry.yarnpkg.com/import-modules/-/import-modules-2.0.0.tgz#9c1e13b4e7a15682f70a6e3fa29534e4540cfc5d"
48594859
integrity sha512-iczM/v9drffdNnABOKwj0f9G3cFDon99VcG1mxeBsdqnbd+vnQ5c2uAiCHNQITqFTOPaEvwg3VjoWCur0uHLEw==
48604860

4861-
imurmurhash@^0.1.4:
4861+
imurmurhash@*, imurmurhash@^0.1.4:
48624862
version "0.1.4"
48634863
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
48644864
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
@@ -6260,6 +6260,11 @@ lockfile@^1.0.4:
62606260
dependencies:
62616261
signal-exit "^3.0.2"
62626262

6263+
lodash._baseindexof@*:
6264+
version "3.1.0"
6265+
resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c"
6266+
integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw=
6267+
62636268
lodash._baseuniq@~4.6.0:
62646269
version "4.6.0"
62656270
resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8"
@@ -6268,11 +6273,33 @@ lodash._baseuniq@~4.6.0:
62686273
lodash._createset "~4.0.0"
62696274
lodash._root "~3.0.0"
62706275

6276+
lodash._bindcallback@*:
6277+
version "3.0.1"
6278+
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
6279+
integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4=
6280+
6281+
lodash._cacheindexof@*:
6282+
version "3.0.2"
6283+
resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92"
6284+
integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI=
6285+
6286+
lodash._createcache@*:
6287+
version "3.1.2"
6288+
resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093"
6289+
integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM=
6290+
dependencies:
6291+
lodash._getnative "^3.0.0"
6292+
62716293
lodash._createset@~4.0.0:
62726294
version "4.0.3"
62736295
resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
62746296
integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=
62756297

6298+
lodash._getnative@*, lodash._getnative@^3.0.0:
6299+
version "3.9.1"
6300+
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
6301+
integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=
6302+
62766303
lodash._reinterpolate@^3.0.0:
62776304
version "3.0.0"
62786305
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
@@ -6338,6 +6365,11 @@ lodash.map@^4.5.1:
63386365
resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3"
63396366
integrity sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=
63406367

6368+
lodash.restparam@*:
6369+
version "3.6.1"
6370+
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
6371+
integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=
6372+
63416373
lodash.set@^4.3.2:
63426374
version "4.3.2"
63436375
resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23"
@@ -7478,7 +7510,7 @@ os-locale@^3.1.0:
74787510
lcid "^2.0.0"
74797511
mem "^4.0.0"
74807512

7481-
os-name@^3.0.0, os-name@^3.1.0:
7513+
os-name@^3.1.0:
74827514
version "3.1.0"
74837515
resolved "https://registry.yarnpkg.com/os-name/-/os-name-3.1.0.tgz#dec19d966296e1cd62d701a5a66ee1ddeae70801"
74847516
integrity sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==
@@ -9690,6 +9722,11 @@ tunnel-agent@^0.6.0:
96909722
dependencies:
96919723
safe-buffer "^5.0.1"
96929724

9725+
tunnel@0.0.6:
9726+
version "0.0.6"
9727+
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c"
9728+
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==
9729+
96939730
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
96949731
version "0.14.5"
96959732
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
@@ -9869,13 +9906,6 @@ unist-util-visit@^1.1.0:
98699906
dependencies:
98709907
unist-util-visit-parents "^2.0.0"
98719908

9872-
universal-user-agent@^2.0.3:
9873-
version "2.1.0"
9874-
resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-2.1.0.tgz#5abfbcc036a1ba490cb941f8fd68c46d3669e8e4"
9875-
integrity sha512-8itiX7G05Tu3mGDTdNY2fB4KJ8MgZLS54RdG6PkkfwMAavrXu1mV/lls/GABx9O3Rw4PnTtasxrvbMQoBYY92Q==
9876-
dependencies:
9877-
os-name "^3.0.0"
9878-
98799909
universal-user-agent@^4.0.0:
98809910
version "4.0.0"
98819911
resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-4.0.0.tgz#27da2ec87e32769619f68a14996465ea1cb9df16"

0 commit comments

Comments
 (0)