Question about github storage
# ask-community
b
Question about github storage
I have a flow that is registered and is using github storage with this configuration
Copy code
access_token_secret=os.getenv("PREFECT__CONTEXT__SECRETS__GITHUB_ACCESS_TOKEN")
I’m trying to test with a PAT I generated today, setting
GITHUB_ACCESS_TOKEN
in the Context part of the UI when I run the flow
However, I still get a 401 from github
k
Are you on Prefect Server or Cloud?
b
prefect cloud
k
So you should store the secret on Prefect cloud, and then in the
access_token_secret
, provide the Secret name.
Copy code
access_token_secret="GITHUB_ACCESS_TOKEN"
Prefect will then fetch it on the execution side for you
b
gotcha
If I’d like to avoid adding a
GITHUB_ACCESS_TOKEN
to the secrets, say I add a
GITHUB_ACCESS_TOKEN_BRIANSORAHAN
with my PAT, how do I use this in a run I start via the UI?
k
You would need to add that in the flow so it knows what secret to use to pull it down and register. The alternative is putting that env variable on the agent and using a local secret if you don’t want it stored on prefect cloud
👍 1