Allow auto login via password / tokens for Yak push

I’m trying to set up a GitHub action for auto building and pushing my GH plugin.

The current problem of making everything automated is the login process.

By default, if I do it on my own computer, the yak login will open a webpage and I need to click it to log into my account.

However, this process is not feasible for Github Actions…

Is there a way to pass this step with some login token?

yak login --ci
will give you a token you can use

Thanks! super fast reply.

for

https://accounts.rhino3d.com/oauth2/auth?response_type=id_token+token&client_id=yak&redirect_uri=http://localhost:5123/&scope=profile+openid+email+noexpire&state=<token>`

You mean the token is the token part?
How do I use it for yak login then?

When running yak login --ci the browser still opens.

Yes, It’ll put a token into your command line you can copy and paste into your github secrets, then use that as an environment variable.

~\gits
❯ & $yak login --ci
Your browser has been opened to visit:

https://accounts.rhino3d.com/oauth2/auth?response_type=id_token+token&client_id=yak&redirect_uri=http://localhost:5123/&scope=profile+openid+email+noexpire&state=<redacted>

Your non-expiring(+) token is shown below. Use this to set the YAK_TOKEN
environment variable on your build machine. Remember to keep it safe!

- - - - - - - - -

<REDACTED>

- - - - - - - - -

+ OK, actually this token expires in 49 years (2075-03-20T16:30:19.8313115+01:00)

Wait, then how do you use that YAK_TOKEN variable?

Am I suppose to use any mcneel provided action files, OR, how should I use that token with yak command? Will it find a Environmental variable automatically?

In your Github Action you can provide the api token (YAK_TOKEN) as an environment variable and then you don’t need to login in the github action ci run.

Example below:

1 Like