Getting started
Prerequisites
Install prefect-github
Install or update to the latest version of the prefect-github library and dependencies.Register newly installed block types
Register the block types in the prefect-github module to make them available for use.Examples
In the examples below, you create blocks with Python code. Alternatively, blocks can be created through the Prefect UI. To create a deployment and run a deployment where the flow code is stored in a private GitHub repository, you can use theGitHubCredentials
block.
A deployment can use flow code stored in a GitHub repository without using this library in either of the following cases:
- The repository is public
- The deployment uses a Secret block to store the token
Access flow code stored in a private GitHub repository in a deployment
Use the credentials block you created above to pass the GitHub access token during deployment creation. The code below assumes there’s flow code stored in a private GitHub repository.prefect.yaml
file to create the deployment, reference the GitHub Credentials block in the pull
step: