How to use GitLab storage block

Install the collection: pip install prefect-gitlab

Register the blocks:

prefect block register -m prefect_gitlab

Create PAT:

Then, use that PAT as secret in your block configuration. You can do that from the UI or from Python:

from prefect_gitlab.credentials import GitLabCredentials
from prefect_gitlab.repositories import GitLabRepository

gitlab_repo = GitLabRepository(
   credentials=GitLabCredentials(token="GITLAB_ACCESS_TOKEN"))"default", overwrite=True)

Finally, use that block in your deployment:

prefect deployment build -sb gitlab-repository/default -a