Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mjsol12 authored Jan 20, 2025
1 parent 85b1c86 commit 4450706
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Trigger Target Repository Workflow

on:
push:
branches:
- main
- stage
- testing

jobs:
notify:
runs-on: ubuntu-latest

steps:
- name: Trigger Target Repository
run: |
BRANCH_NAME=${GITHUB_REF##*/}
echo "Triggering deployment for branch: $BRANCH_NAME"
RESPONSE=$(curl -s -o response.json -w "%{http_code}" -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
https://api.github.com/repos/navnorth/wp-nn-dot-com/dispatches \
-d "{\"event_type\": \"trigger-sync-theme\", \"client_payload\": {\"branch\": \"$BRANCH_NAME\"}}")
echo "API Response Code: $RESPONSE"
cat response.json

0 comments on commit 4450706

Please sign in to comment.