Closed lpezet closed 8 months ago
Hi there @lpezet :wave:!
Thank you for opening an issue. Our team will triage this as soon as we can. Please take a moment to review the troubleshooting steps which lists common error messages and their resolution steps.
Hi @lpezet - thank you for opening an issue. act
is not officially supported by GitHub, and I'm opposed to adding specific logic for ecosystem tooling. OIDC is not specific to Google Cloud (AWS, Azure, and other IDPs support federated identity), so it would be better to raise this issue to act
and have the act
runtime serve the OIDC URLs and tokens.
In your case, you could probably inject CLOUDSDK_AUTH_ACCESS_TOKEN
and add an if
conditional in your workflow to skip the auth action if that envvar is defined.
It's not really about act
. I used it only as an example.
My actual case is actually when using Terraform and Google Provider.
I'll skip google-github-actions/auth
as you mentioned, and figure out a different way then.
Thanks.
TL;DR
Supporting local testing, like using Nektos'
act
to test workflows locally.Disclaimer: 1) In the WIF case, I don't fully comprehend how ACTIONS_ID_TOKEN_REQUEST_TOKEN is generated by Github. And maybe there's an easy way to work with it (generate one? that would sound like a security flaw...no?), and 2) I also do not understand the other possible setups with
google-github-actions/auth
.Detailed design
When using Workload Identity Federation, the usual setup is something like:
Now the problem then comes when testing such workflow locally.
Considering the following:
X
is the configuration needed on Github for a workflow to pass, testingX-n
configuration, wheren
is as small as possible, it still meaningful. I can focus on then
changes if my workflow is still not working. In layman terms, don't ask me to switch from WIF to service account keys for the sake of testing.google-github-actions/auth
's goal is to provide an environment where credentials are available for tools likegcloud
to function.It would be very useful to test my workflow as such:
Additional information
In this specific situation, the problem lies with https://github.com/google-github-actions/auth/blob/main/src/main.ts#L108, where
ACTIONS_ID_TOKEN_REQUEST_TOKEN
andACTIONS_ID_TOKEN_REQUEST_URL
are not provided (the URL one could easily be provided though).One solution could be to tweak the
if()
logic at https://github.com/google-github-actions/auth/blob/main/src/main.ts#L100. Change the existing logic:to something like this:
Security-wise, it's not worse than service keys (it's actually an impractical middle ground between WIF and service account keys, if someone really really wanted to use this beyond local testing, in Github that is).