Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate workshop update requirements with each FESTIM release #72

Open
jhdark opened this issue Jul 31, 2024 · 0 comments
Open

Automate workshop update requirements with each FESTIM release #72

jhdark opened this issue Jul 31, 2024 · 0 comments

Comments

@jhdark
Copy link
Collaborator

jhdark commented Jul 31, 2024

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):

  • Go to your GitHub settings.
  • Navigate to "Developer settings" > "Personal access tokens".
  • Generate a new token with repo scope.

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

  • Create a new workflow file in repository B (e.g., .github/workflows/dispatch.yml).
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:

  • Go to the settings of repository B.
  • Navigate to "Secrets and variables" > "Actions".
  • Add a new secret named PAT with the value of the PAT you generated.

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

  • Create a new workflow file in repository A (e.g., .github/workflows/on-dispatch.yml).
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:

  • The workflow in repository B triggers a repository dispatch event to repository A whenever a release is published.
  • The workflow in repository A listens for the repository_dispatch event with the type release-trigger and runs the specified jobs.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant