diff --git a/prefect.yaml b/prefect.yaml index b5e139172..1bec8958d 100644 --- a/prefect.yaml +++ b/prefect.yaml @@ -6,21 +6,15 @@ definitions: name: kubernetes-prd-internal-tools job_variables: image: prefecthq/prefect:3.1.11-python3.12 - + command: uv run --with git+https://github.com/PrefectHQ/prefect-collection-registry.git@revamp-registry-flow python -m prefect.engine build: push: pull: - prefect.deployments.steps.git_clone: - repository: https://github.com/PrefectHQ/prefect-collection-registry + repository: https://github.com/PrefectHQ/prefect-collection-registry.git branch: revamp-registry-flow -- prefect.deployments.steps.run_shell_script: - script: | - ls -la - cd prefect-collection-registry - ls -la - uv sync --frozen deployments: - name: update-all-collections diff --git a/src/prefect_collection_registry/update_collection_metadata.py b/src/prefect_collection_registry/update_collection_metadata.py index 4370fb16e..028d3bfd4 100644 --- a/src/prefect_collection_registry/update_collection_metadata.py +++ b/src/prefect_collection_registry/update_collection_metadata.py @@ -192,7 +192,9 @@ async def read_stream(stream: Any, buffer: list[str]) -> None: async def update_all_collections( branch_name: str = "update-metadata", ): - """Checks all collections for releases and updates the metadata if needed.""" + """Updates all collections for releases and updates the metadata if needed.""" + os.environ["GITHUB_TOKEN"] = await Secret.aload("gh-util-token").get() # type: ignore + if branch_name == "update-metadata": # avoid overwriting existing branches branch_name = f"update-metadata-{DateTime.now().format('MM-DD-YYYY-HH-MM-SS')}" @@ -257,5 +259,4 @@ async def update_all_collections( if __name__ == "__main__": - os.environ["GITHUB_TOKEN"] = Secret.load("gh-util-token").get() # type: ignore asyncio.run(update_all_collections())