googlesheets4 usage with GitHub Actions

Can anyone provide some guidance around proper usage of googlesheets4 through GitHub Actions?

Super easy to setup locally, but very unclear on how to do it through automation on GitHub Actions. I have been testing everything I can find for the past 2 days, and I got this one to work: Remote server authentication to read Googlesheets from R script not using service accounts? - Stack Overflow
But I really don't want to save an actual file for the authentication on GitHub. I want to pass a GitHub secret for the authentication, and nothing I try seems to work.

This is the best I could come up with, but it's not working:

I enabled the sheets API and gave it permission to all scopes within google sheets. And I can't find a way to authenticate passing a service account as a string.

Can anyone please help me figure out how to do this type of GitHub actions authentication with a secret? Would be very much appreciated. Alternatively maybe I could have a secret that I use to encode and decode the .json file?

Would love any help anyone can offer :slightly_smiling_face:

I'm not sure about using GitHub, but I ran into a similar issue when deploying a Shiny app using googlesheets4 and this resource really helped me.

Part of the deployment process entails utilizing an authentication secret, so perhaps it can be of use.