diff --git a/.github/workflows/pr_views_to_core.yml b/.github/workflows/pr_views_to_core.yml index efeb75c20..91ac55f5d 100644 --- a/.github/workflows/pr_views_to_core.yml +++ b/.github/workflows/pr_views_to_core.yml @@ -7,6 +7,9 @@ on: # paths: # - 'views/aggregate-worker-metadata.json' +env: + PREFECT_API_KEY: ${{ secrets.PREFECT_PRD_INTEGRATIONS_WORKSPACE_API_KEY }} + jobs: update-views: name: Send updated views to PrefectHQ/prefect @@ -26,6 +29,9 @@ jobs: python -m pip install --upgrade pip python -m pip install --upgrade --upgrade-strategy eager -e ".[dev]" + - name: Set workspace + run: prefect cloud workspace set -w prefect-technologies/integrations + - name: Open PRs to PrefectHQ/prefect run: python src/pr_views_to_core.py diff --git a/src/pr_views_to_core.py b/src/pr_views_to_core.py index 900d67e0d..31517d49e 100644 --- a/src/pr_views_to_core.py +++ b/src/pr_views_to_core.py @@ -5,7 +5,9 @@ import httpx from datetime import datetime -GITHUB_TOKEN = os.environ['GITHUB_TOKEN'] +from prefect.blocks.system import Secret + +GITHUB_TOKEN = Secret.load("collection-registry-contents-prs-rw-pat").get() SOURCE_REPO_URL = 'https://raw.githubusercontent.com/PrefectHQ/prefect-collection-registry/main/views/aggregate-worker-metadata.json' TARGET_FILE_PATH = 'src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json' # noqa E501 TARGET_ORG = 'PrefectHQ'