festim-dev / FESTIM-workshop

Learn how to simulate hydrogen transport with FESTIM
Apache License 2.0
15 stars 7 forks source link

Automate workshop update requirements with each FESTIM release #72

Open jhdark opened 1 month ago

jhdark commented 1 month ago

Need to find a way to automate either notifications or PR's to update the workshop with each subsequent release of FESTIM.

Copilot suggests: Yes, you can trigger a workflow in repository A whenever a release is made in repository B using GitHub Actions and repository dispatch events. Here’s a step-by-step guide:

1. Create a Personal Access Token (PAT):

2. Set up a workflow in repository B to trigger repository dispatch:

name: Dispatch to Repo A

on:
  release:
    types: [published]

jobs:
  dispatch:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger repository dispatch
        uses: peter-evans/repository-dispatch@v2
        with:
          token: ${{ secrets.PAT }}
          repository: user/repoA
          event-type: release-trigger

3. Add the PAT as a secret in repository B:

4. Create a workflow in repository A to respond to the dispatch event:

name: On Dispatch Event

on:
  repository_dispatch:
    types: [release-trigger]

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      # Add your steps here
      - name: Run a script
        run: echo "Release made in repository B"

In this setup:

Make sure to replace user/repo A with the actual owner and repository name of repository A.

Alternatively, we could use a program called Dependabot

Eitherway, its something to consider both here and for the V&V book