-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
patrick borowy
committed
Aug 19, 2024
1 parent
01772d4
commit e8e64a9
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Notify External Repository on Update | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
notify-external-update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Trigger Repository Dispatch Event | ||
env: | ||
REPOSITORY_ACCESS: ${{ secrets.REPOSITORY_ACCESS }} | ||
run: | | ||
# Extract the repository name from the full GITHUB_REPOSITORY environment variable (format "owner/repo") | ||
REPO_NAME="${GITHUB_REPOSITORY#*/}" | ||
# The target repository where you want to trigger the dispatch event | ||
TARGET_OWNER="exorde-labs" | ||
TARGET_REPO="spot" | ||
# Trigger a repository dispatch event in the target repository | ||
curl -X POST \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-H "Authorization: token $REPOSITORY_ACCESS" \ | ||
"https://api.github.com/repos/${TARGET_OWNER}/${TARGET_REPO}/dispatches" \ | ||
-d "{\"event_type\": \"trigger-build-event\", \"client_payload\": {\"moduleName\": \"${REPO_NAME}\"}}" |