Update JSON and Create PR #363
This file contains hidden or 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: Update JSON and Create PR | |
| on: | |
| schedule: | |
| # Run the workflow every day at midnight UTC | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| update-json: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| pip install -e . | |
| - name: Update JSON file | |
| env: | |
| MYSQL_HOST: ${{ vars.MYSQL_HOST }} | |
| MYSQL_DATABASE_NAME: ${{ vars.MYSQL_DATABASE_NAME }} | |
| MYSQL_USERNAME: ${{ secrets.MYSQL_USERNAME }} | |
| MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }} | |
| run: | | |
| postprocess | |
| visualization | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: update-json-file # Branch to create the PR from | |
| base: main # Branch to create the PR into | |
| committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
| author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> | |
| title: "Automated PR: Update JSON file" | |
| body: "This PR was automatically created by GitHub Actions to update the JSON file." | |
| reviewers: anyangml |