Skip to content

Commit 4450706

Browse files
authored
Create main.yml
1 parent 85b1c86 commit 4450706

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/main.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Trigger Target Repository Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- stage
8+
- testing
9+
10+
jobs:
11+
notify:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Trigger Target Repository
16+
run: |
17+
BRANCH_NAME=${GITHUB_REF##*/}
18+
echo "Triggering deployment for branch: $BRANCH_NAME"
19+
RESPONSE=$(curl -s -o response.json -w "%{http_code}" -X POST \
20+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
21+
-H "Accept: application/vnd.github.everest-preview+json" \
22+
https://api.github.com/repos/navnorth/wp-nn-dot-com/dispatches \
23+
-d "{\"event_type\": \"trigger-sync-theme\", \"client_payload\": {\"branch\": \"$BRANCH_NAME\"}}")
24+
25+
echo "API Response Code: $RESPONSE"
26+
cat response.json

0 commit comments

Comments
 (0)