Yanic Möller
01/03/2024, 1:43 PMprefect config set PREFECT_API_URL=${{ env.PREFECT_API_URL }}
prefect config set PREFECT_API_KEY=${{ secrets.PREFECT_API_KEY }}
prefect cloud login --key ${{ secrets.PREFECT_API_KEY }} --workspace ${{ env.PREFECT_WORKSPACE }}
The third line produces the following response:
It looks like you're already authenticated on this profile.
? Would you like to reauthenticate? [y/N]:
When running these commands in a terminal, if I enter y
I can login successfully. Is there any other way to connect to Prefect Cloud through the terminal / GithHub Actions so that I don't have to enter y
again? Without that, the Action is useless and pressing y
manually is not feasible for my use-cases.Nate
01/03/2024, 1:51 PMprefect --no-prompt <some-command>
although in this case, if you set your api key and url as env vars, you shouldn't actually have to call login
yourself, you should be able to do
prefect config set PREFECT_API_URL=${{ env.PREFECT_API_URL }}
prefect config set PREFECT_API_KEY=${{ secrets.PREFECT_API_KEY }}
prefect cloud workspace set --workspace ${{ env.PREFECT_WORKSPACE }}
Nate
01/03/2024, 1:52 PMYanic Möller
01/03/2024, 2:55 PMprefect cloud workspace set --workspace ${{ env.PREFECT_WORKSPACE }}
it works just fine. 🙌
I've also tested the prefect --no-prompt cloud login ...
approach. Here I still get the old undesired response. However, this is not a problem for me.Nate
01/03/2024, 3:07 PM-y
flag to the login
command to avoid prompting, but great - glad that works for you!