What happened?
It looks like between 5.0.4 and 5.0.5 dependencies were updated. I suspect that the upgrade from @octokit/request 6.0.0 to 7.0.0 may have caused this issue.
The following code throws an error in 5.0.5 when run under actions/github-script@v6
const { createAppAuth } = require("@octokit/auth-app");
const key = `${{ secrets.PrivKey }}`
var auth = createAppAuth({appId: "${{vars.APPID}}", privateKey: key });
var authentication = await auth({type: "installation", installationId: "${{vars.INSTALLID}}" })
return authentication.token
Error:
Error: Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer.
at fetchWrapper (/home/runner/work/tf-project/tf-project/node_modules/@octokit/request/dist-node/index.js:56:11)
at newApi (/home/runner/work/tf-project/tf-project/node_modules/@octokit/request/dist-node/index.js:176:14)
at getInstallationAuthentication (/home/runner/work/tf-project/tf-project/node_modules/@octokit/auth-app/dist-node/index.js:238:13)
at async eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15143:16), <anonymous>:34:[22](https://github.com/sah-test/tf-project/actions/runs/5316189964/jobs/9625440887#step:4:23))
at async main (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15[23](https://github.com/sah-test/tf-project/actions/runs/5316189964/jobs/9625440887#step:4:24)6:20)
Error: Unhandled error: Error: Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer.
Makes me also wonder if the semver should be bumped by a major version if dependencies are bumped by a major version..
Thanks,
Shane
Versions
@octokit/[email protected] actions/github-script@v6
Relevant log output
Run actions/github-script@v6
with:
script: const { createAppAuth } = require("@octokit/auth-app");
const key = `***
`
var auth = createAppAuth({appId: "***", privateKey: key });
var authentication = await auth({type: "installation", installationId: "***" })
return authentication.token
github-token: ***
debug: false
user-agent: actions/github-script
result-encoding: json
retries: 0
retry-exempt-status-codes: 400,401,403,404,422
env:
WORKING_DIR: .
ENVIRONMENT: development
Error: Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer.
at fetchWrapper (/home/runner/work/tf-project/tf-project/node_modules/@octokit/request/dist-node/index.js:56:11)
at newApi (/home/runner/work/tf-project/tf-project/node_modules/@octokit/request/dist-node/index.js:176:14)
at getInstallationAuthentication (/home/runner/work/tf-project/tf-project/node_modules/@octokit/auth-app/dist-node/index.js:238:13)
at async eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15143:16), <anonymous>:34:22)
at async main (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15236:20)
Error: Unhandled error: Error: Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer.
Code of Conduct
What happened?
It looks like between 5.0.4 and 5.0.5 dependencies were updated. I suspect that the upgrade from @octokit/request 6.0.0 to 7.0.0 may have caused this issue.
The following code throws an error in 5.0.5 when run under actions/github-script@v6
Error:
Makes me also wonder if the semver should be bumped by a major version if dependencies are bumped by a major version..
Thanks,
Shane
Versions
@octokit/[email protected] actions/github-script@v6
Relevant log output
Run actions/github-script@v6 with: script: const { createAppAuth } = require("@octokit/auth-app"); const key = `*** ` var auth = createAppAuth({appId: "***", privateKey: key }); var authentication = await auth({type: "installation", installationId: "***" }) return authentication.token github-token: *** debug: false user-agent: actions/github-script result-encoding: json retries: 0 retry-exempt-status-codes: 400,401,403,404,422 env: WORKING_DIR: . ENVIRONMENT: development Error: Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer. at fetchWrapper (/home/runner/work/tf-project/tf-project/node_modules/@octokit/request/dist-node/index.js:56:11) at newApi (/home/runner/work/tf-project/tf-project/node_modules/@octokit/request/dist-node/index.js:176:14) at getInstallationAuthentication (/home/runner/work/tf-project/tf-project/node_modules/@octokit/auth-app/dist-node/index.js:238:13) at async eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15143:16), <anonymous>:34:22) at async main (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15236:20) Error: Unhandled error: Error: Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer.Code of Conduct