Credentials injection in plugin

Hi I’m trying to write a custom plugin to make some checks on the cloned git repo and I need to programmatically do a “git fetch --all” in my plugin code.

I found that git credentials are stored in /root/.netrc file and I can read that file on every image I may use in steps.

However when I run my plugin code that file is not there. Is there any way to access git credentials in a custom plugin?