Skip to content
Latchkey

How to Trigger a Workflow When the Repository Is Forked in GitHub Actions

The fork event fires in the upstream repository whenever someone forks it, exposing the new fork in the payload.

Add on.fork (it has no activity types). Read github.event.forkee.full_name to know which fork was created and notify or onboard the contributor.

Steps

  • Add fork: under on.
  • Read github.event.forkee.full_name for the new fork.
  • Send a notification or start onboarding automation.

Workflow

.github/workflows/on-fork.yml
on:
  fork:
jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - run: echo "Repo forked to ${{ github.event.forkee.full_name }}"

Gotchas

  • The fork event has no types: filter; it always fires on any fork.
  • It runs in the source repository, so it has access to that repository secrets.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →