Skip to content

Commit

Permalink
Update trigger a workflow run in another repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelazaroff committed Jan 5, 2024
1 parent a8d887a commit 506b97e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions github/trigger-a-workflow-run-in-another-repo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Trigger a workflow run in another repo

This is kind of meta: I made a separate repo [`todayilearned`](https://github.com/jakelazaroff/todayilearned) with the website for the content in this repo, and I wanted to trigger a new deploy whenever I pushed a new TIL. The TL;DR is that there needs to be a GitHub Actions workflow in each repo: one in the "source" to send a [`repository_dispatch` event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch) to the "destination", and one in the destination to do the actual building/deploying/what have you.
This is kind of meta: I made a separate repo [`todayilearned`](https://github.com/jakelazaroff/todayilearned) with the website for the content in this repo, and I wanted to trigger a new deploy whenever I pushed a new TIL.

The TL;DR is that there needs to be a GitHub Actions workflow in each repo: one in the "source" to send a [`repository_dispatch` event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch) to the "destination", and one in the destination to do the actual building/deploying/what have you.

I'm sure this has been written in a zillion different places, but it took me a bit of searching to figure out so here goes:

Expand All @@ -16,7 +18,7 @@ I'm sure this has been written in a zillion different places, but it took me a b
2. Create a [Personal Access Token](https://github.com/settings/tokens?type=beta).
- The new fine-grained tokens require an expiration date with a max of two years, at which point I'll definitely have forgotten about all this, but luckily I'll be able to refer back to this TIL to figure it out again.
- The new fine-grained tokens require an expiration date with a max of two years, at which point I'll definitely have forgotten about all this. But luckily I'll be able to refer back to this TIL to figure it out again!
- The only repository access needed is the destination (i.e. the one receiving the event).
- The only required permissions are read and write access for `content` (which covers the dispatch event) and `metadata` (which I think is mandatory for all personal access tokens).

Expand Down

0 comments on commit 506b97e

Please sign in to comment.