-
Notifications
You must be signed in to change notification settings - Fork 89
36 lines (32 loc) · 1.61 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
name: Trigger External Workflow
on:
pull_request_target:
types: [opened, edited, synchronize]
jobs:
trigger_dispatch:
runs-on: ubuntu-latest
steps:
- name: Check repository
run: |
echo "IS_SPECIFIC_REPOSITORY=${{ github.repository == 'analogdevicesinc/ai8x-training' }}" >> $GITHUB_ENV
echo "IS_DEVELOP_BRANCH=${{ github.ref == 'refs/heads/develop' }}" >> $GITHUB_ENV
- name: Set up environment
if: env.IS_SPECIFIC_REPOSITORY == 'true' && env.IS_DEVELOP_BRANCH == 'true'
run: |
PR_Branch=${{ github.event.pull_request.head.ref }}
Repository=${{ github.event.pull_request.head.repo.full_name }}
PR_Number=${{ github.event.pull_request.number }}
PR_Sha=${{ github.event.pull_request.head.sha }}
echo "PR_Branch: $PR_Branch"
echo "Repository: $Repository"
echo "PR_Number: $PR_Number"
echo "PR_Sha: $PR_Sha"
- name: Dispatch event
if: env.IS_SPECIFIC_REPOSITORY == 'true' && env.IS_DEVELOP_BRANCH == 'true'
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.REGRESSION_TEST }}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/MaximIntegratedAI/ai8x-regression/dispatches" \
-d '{"event_type": "repo-pull-request", "client_payload": {"PR_Branch": "${{ github.event.pull_request.head.ref }}", "Repository": "${{ github.event.pull_request.head.repo.full_name }}","PR_Number": "${{ github.event.pull_request.number }}","PR_Sha": "${{ github.event.pull_request.head.sha }}" }'