<@ULVA73B9P> When passing parameters to `prefect.d...
# ask-marvin
j
@Marvin When passing parameters to
prefect.deployments.steps.git_clone
, can I use a deploy key rather than a personal access token?
m
The Prefect documentation for both versions 2.x and 3.x emphasizes the use of personal access tokens (PATs) for authentication when cloning repositories through
git_clone
during deployments. There's no direct mention of using deploy keys specifically in the context of
prefect.deployments.steps.git_clone
. For security and flexible access limitation, PATs are commonly recommended. Here's a relevant excerpt from the Prefect 2.x documentation that might be helpful: "We recommend using HTTPS with Repository, Project, or Workspace Access Tokens." You can find more about Prefect deployments and authentication here for Prefect 2.x and here for Prefect 3.x. If you're hoping to use a deploy key, you might need to implement additional steps or scripts outside of Prefect's built-in functionalities, or check the Prefect GitHub repository for related discussions. Hope this helps; remember, even robots have to keep up with documentation updates every now and then!
j
@Marvin What is the correct syntax for referring to a githubcredentials block for reference during deployment in a prefect.yaml? The following returns a 404 error even though there is a GitHubCredentials block named
org-scripts-github-repo-access-token
.
Copy code
[
  {
    "prefect.deployments.steps.git_clone": {
      "branch": "master",
      "repository": "<https://github.com/org/org-scripts.git>",
      "credentials": "{{ prefect.blocks.githubcredentials.org-scripts-github-repo-access-token" }}"
    }
  }
]
m
The issue you're encountering might stem from incorrect syntax or registration when referencing the GitHubCredentials block in your
prefect.yaml
. Here's the correct way to reference it according to the latest documentation: In Prefect 2.x and 3.x, you should use:
Copy code
yaml
credentials: "{{ prefect.blocks.github-credentials.org-scripts-github-repo-access-token }}"
Ensure the following: 1. Your block name is correctly spelled and matches exactly with the one created in the Prefect UI or via code. 2. The block type is correctly specified as
github-credentials
and not just
githubcredentials
. 3. The block has been registered appropriately using Prefect commands, such as
prefect block register -m prefect_github
. For further details, you can explore the Prefect documentation for Prefect 2.x and Prefect 3.x. If it's still not working, double-check the Prefect CLI or UI configuration for any additional misconfigurations or updates needed. It's like searching for a specific neuron in my neural network—sometimes things get misplaced!