Closed jamacku closed 8 months ago
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs
. You & others like you are the reason all of this works! So thank you & happy coding! 🚀
You don't need @octokit/core
when using @actions/github
@actions/github
requires v5 @octokit/core
, which breaks newer @octokit/core
versions defined as dependencies
Also, I recommend using esbuild
instead of ncc
as it creates more readable output files, and correctly ouputs ESM, and is much simpler. (From https://github.com/octokit/graphql-action/pull/255#issuecomment-1913661963)
Use https://github.com/actions/create-github-app-token/ as a reference
@wolfy1339 Thank you for your help! I have removed @octokit/core
, and it works as expected.
I'm just a bit confused as to why I'm able to import { Octokit } from '@octokit/core';
without an error.
https://github.com/redhat-plumbers-in-action/regression-sniffer/blob/main/src/octokit.ts#L2
Thank you for suggesting esbuild
. I'll have a look.
In v6 of @octokit/core
we switched to ESM, in v5 we were outputting CJS.
Since you are using plugins, you will have to stick with @octokit/core
v5 until @probot/octokit-plugin-config
is updated and remove @actions/github
Also, I recommend using
esbuild
instead ofncc
as it creates more readable output files, and correctly ouputs ESM, and is much simpler. (From octokit/graphql-action#255 (comment))
I second that. Use esbuild
. I used ncc
in the past but esbuild
is the better tool to bundle code for actions if your source is ESM
What happened?
This is probably a very silly beginner issue, but I can't figure out what is wrong. I'm using
@octokit/core
in most of my GHA and all of then breaks when updating tov6
+. I usencc
for compiling TypeScript to single file as suggested in officialtypescript-action
template.All actions behave exactly the same after updating to
v6
. The call ofncc
fails with:Example from one of my actions: https://github.com/redhat-plumbers-in-action/regression-sniffer/actions/runs/8140133727/job/22244735285?pr=50#step:6:8
This can be also 100% reproduce locally:
package.json:
Thank you for any help or suggestions.
Versions
@octokit/core
:v6.0.0
,v6.0.1
node
:v20.11.1
npm
:10.2.4
yarn
:4.1.0
Relevant log output
Code of Conduct