File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments