Varun-Kolanu / issue-assigner

A bot for managing issue assignments
https://probot.github.io/apps/issue-assigner/
ISC License
14 stars 2 forks source link

Fix YAML encoding #2

Closed AaronDewes closed 3 months ago

AaronDewes commented 3 months ago

fs.readFileSync already returns a buffer. Doing Buffer.from seems to implicitly convert it to a string and cause the issue at https://github.com/probot/probot/issues/2030

Varun-Kolanu commented 3 months ago

Thank you so much to take your time out and make a PR Aaron!

I actually tried that too but I am not able to solve the error. Will try more methods and will update

Varun-Kolanu commented 3 months ago

@AaronDewes Actually the rest api for contents of github repo is returning the yml file contents in base64 string. But ocktokit is decoding it and giving it in a string format of utf-8. So as I was mocking the api call, I was replying with base64. When I changed it to be in utf-8, it worked!