actions-on-google / gactions

Apache License 2.0
49 stars 8 forks source link

How to automate `gactions login`? #2

Closed vicly closed 3 years ago

vicly commented 3 years ago

We'd like to run gactions CLI in CICD pipeline so to automatically publish the project defined in YAML files. To automate the process, gactions login is tricky for us, is there any way to automate it?

Our current solution is manually to copy ~/.credentials/gactions-actions.googleapis.com-go.json to the agent machine, which is working, but

  1. gactions-actions.googleapis.com-go.json is Google user-specific, a dedicated user for CICD is required => internal process + extra user management
  2. gaction login will invalidate the previous credentials => a risky point about human error

May we know whether gactions support service account JSON file generated in GCP console or any other idea to solve this problem? Thanks.

Fleker commented 3 years ago

I'm glad you have a solution that does work for you right now. gactions does not support alternate authentication methods at the moment. However, in the Conversation Testing library you do create a service account and use that to run methods, so it may be possible to at some point use the underlying Actions API to authorize requests.

vicly commented 3 years ago

@Fleker, thanks for your response. The features of gaction are quite useful in the automation area, it'll be great if it could support an alternative auth method in the future.