Skip to content

Commit 0dda597

Browse files
committed
chore: add a workflow to trigger the workflow of another repo
1 parent 80aa29a commit 0dda597

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Trigger Update Contributors in frontend.mu
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- closed
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
trigger:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Trigger Update Contributors in frontend.mu website repository
17+
run: |
18+
# Set the required variables
19+
target_repo_owner="frontendmu"
20+
target_repo_name="frontend.mu"
21+
source_repo_name="${{ github.event.repository.name }}"
22+
event_type="trigger-workflow"
23+
24+
curl -L \
25+
-X POST \
26+
-H "Accept: application/vnd.github+json" \
27+
-H "Authorization: Bearer ${{ secrets.PAT }}" \
28+
-H "X-GitHub-Api-Version: 2022-11-28" \
29+
https://api.github.com/repos/$target_repo_owner/$target_repo_name/dispatches \
30+
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"source_repo\": \"$source_repo_name\", \"unit\": false, \"integration\": true}}"

0 commit comments

Comments
 (0)