Repository navigation
Sync example notebooks from main PGM repo to PGM-workshop #1033
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
| # SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org> | |
| # | |
| # SPDX-License-Identifier: MPL-2.0 | |
| name: Sync example notebooks from main PGM repo to PGM-workshop | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 2 * * *" # Based on UTC time | |
| jobs: | |
| sync-files: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: generate GitHub App token | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| id: generate-token | |
| with: | |
| client-id: ${{ secrets.CI_BOT_APP_ID }} | |
| private-key: ${{ secrets.CI_BOT_PRIVATE_KEY }} | |
| repositories: power-grid-model-workshop | |
| permission-contents: write | |
| permission-pull-requests: write | |
| - name: Checkout PGM workshop repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| path: power-grid-model-workshop | |
| token: ${{ steps.generate-token.outputs.token }} | |
| - name: Checkout PGM Repository examples | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: PowerGridModel/power-grid-model | |
| ref: main | |
| path: power-grid-model | |
| sparse-checkout: docs/examples | |
| sparse-checkout-cone-mode: false | |
| - name: Move pgm examples to pgm workshop repository | |
| run: | | |
| rm -rf power-grid-model-workshop/examples | |
| mv power-grid-model/docs/examples power-grid-model-workshop | |
| - name: Use REs to replace links | |
| run: sed -i 's|\.\./\(.*\)\.md|https://power-grid-model.readthedocs.io/en/stable/\1.html|g' *.ipynb | |
| working-directory: power-grid-model-workshop/examples | |
| - name: create pull request | |
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 | |
| with: | |
| path: power-grid-model-workshop | |
| commit-message: "Update the examples" | |
| branch: "update/examples" | |
| title: "Update the examples from power-grid-model" | |
| body: "This PR updates the example notebooks from the main PGM repository." | |
| labels: "sync-examples" | |
| signoff: true | |
| sign-commits: true | |
| delete-branch: true | |
| base: ${{ github.head_ref }} | |
| token: ${{ steps.generate-token.outputs.token }} |