b

    brian

    9 months ago
    Question about github storage
    I have a flow that is registered and is using github storage with this configuration
    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
    Kevin Kho

    Kevin Kho

    9 months ago
    Are you on Prefect Server or Cloud?
    b

    brian

    9 months ago
    prefect cloud
    Kevin Kho

    Kevin Kho

    9 months ago
    So you should store the secret on Prefect cloud, and then in the
    access_token_secret
    , provide the Secret name.
    access_token_secret="GITHUB_ACCESS_TOKEN"
    Prefect will then fetch it on the execution side for you
    b

    brian

    9 months ago
    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?
    Kevin Kho

    Kevin Kho

    9 months ago
    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