Skip to content

Commit

Permalink
chore: add a workflow to trigger the workflow of another repo
Browse files Browse the repository at this point in the history
  • Loading branch information
derecklhw committed Oct 17, 2024
1 parent 80aa29a commit 2668481
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/trigger_update_contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Trigger Update Contributors

on:
pull_request_target:
types:
- closed
push:
branches:
- main

jobs:
trigger:
runs-on: ubuntu-latest

steps:
- name: Trigger Update Contributors in frontend.mu website repository
run: |
# Set the required variables
target_repo_owner="frontendmu"
target_repo_name="frontend.mu"
source_repo_name="${{ github.event.repository.name }}"
event_type="trigger-workflow"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$target_repo_owner/$target_repo_name/dispatches \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"source_repo\": \"$source_repo_name\", \"unit\": false, \"integration\": true}}"

0 comments on commit 2668481

Please sign in to comment.