Merge pull request #433 from PrefectHQ/update-metadata-10-29-2024 #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Views to PrefectHQ/prefect | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "views/aggregate-worker-metadata.json" | |
workflow_dispatch: | |
env: | |
GITHUB_TOKEN: ${{ secrets.PREFECT_PRS_RW }} | |
jobs: | |
update-views: | |
name: Send updated views to PrefectHQ/prefect | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Open PRs to PrefectHQ/prefect | |
run: | | |
NEW_BRANCH="update-worker-metadata-$(date +%Y%m%d%H%M%S)" | |
TARGET_FILE_PATH="src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json" | |
SOURCE_REPO_URL="https://raw.githubusercontent.com/PrefectHQ/prefect-collection-registry/main/views/aggregate-worker-metadata.json" | |
git clone https://github.com/PrefectHQ/prefect.git | |
cd prefect | |
curl -o $TARGET_FILE_PATH $SOURCE_REPO_URL | |
git checkout -b $NEW_BRANCH | |
git add $TARGET_FILE_PATH | |
git commit -m "Update aggregate-worker-metadata.json" | |
git push --set-upstream origin $NEW_BRANCH | |
gh pr create --repo PrefectHQ/prefect --base main --head $NEW_BRANCH --title "Automated PR for Worker Metadata Update" --body "This is an automated PR to update the worker metadata." |