Can I retrieve the content of a yml file under the data folder in a JavaScript method?

I’m trying to create a github pull-request using the Github API.
So I’d like to retrieve the content of a specific yml file that sits in my project -> update the content - and then create a commit with the updated content.
I’m having trouble accessing the data/*.yml file via a script tag in my partial file.
Is there any way to pass this file as a parameter?

Thanks!

Your question is unclear.

The data folder is not part of your published site. Its contents are selectively read and processed by templates during build. You might consider placing the file within the static directory, or place it within a page bundle as a page resource.