-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use readFileSync instead of require #101
Conversation
@@ -21,7 +20,9 @@ export class Context { | |||
*/ | |||
constructor() { | |||
this.payload = process.env.GITHUB_EVENT_PATH | |||
? require(process.env.GITHUB_EVENT_PATH) | |||
? JSON.parse( | |||
readFileSync(process.env.GITHUB_EVENT_PATH, {encoding: 'utf8'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add error handling here? Make sure the file exists first and print message if not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And while we are here, should we debug print a serialization of the context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error handling yes, serialization of the context seems like a no to me. Its pretty massive, and since we're built to be a dependency I'm a little leary of large debug output that may or may not be helpful, especially since lots of actions probably won't use that directly.
… `@actions/github` package The underlying issue will be fixed directly in the next release of the package. actions/toolkit#101
What's the release schedule for the |
… `@actions/github` The underlying issue will be fixed directly in the next release of the package. actions/toolkit#101
… `@actions/github` (#31) The underlying issue will be fixed directly in the next release of the package. actions/toolkit#101
Just published, sorry for the delay - https://www.npmjs.com/package/@actions/github |
This should simplify webpack configs so we avoid things like #100