When using Github Storage I have two issues. The f...
# ask-community
a
When using Github Storage I have two issues. The first is that it exposes the secret in the
KeyError
. The second is that it is showing me the correct key and yet stating that it was not found. I have the secrets defined in the Prefect UI
Copy code
Failed to load and execute Flow's environment: KeyError('The secret <secret> was not found.  Please ensure that it was set correctly in your tenant: <https://docs.prefect.io/orchestration/concepts/secrets.html>')
I followed the docs to establish the secret and am using the same variable name in both the UI and the code.
GH_TOKEN
Copy code
GH_TOKEN = Secret("GH_TOKEN").get()

STORAGE = GitHub(
    repo="<my_repo_name",
    path=f"flows/my_flow.py",
    access_token_secret=GH_TOKEN
)
z
Hi @Alex Welch -- it displays the value of your secret in that error? The code explicitly just grabs the name
Copy code
raise KeyError(f"The secret {self.name} was not found.  Please ensure that it ...")
Ah in your code you are calling
.get()
on your secret! You'll want to just pass the name of the secret
access_token_secret="GH_TOKEN"
and let it be resolved at runtime.
a
ahhhh
i was treating it like an environment variable, thats where my mistake took place
This is the section that confused me