-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (49 loc) · 1.42 KB
/
dispatch.yml
File metadata and controls
53 lines (49 loc) · 1.42 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Dispatch to SDKs
on:
push:
branches: [main]
paths:
- 'openapi.yaml'
- 'fixtures/**'
permissions: {}
jobs:
fan-out:
name: Trigger contract tests across SDK repos
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk:
- audd-python
- audd-node
- audd-go
- audd-rust
- audd-php
- audd-swift
- audd-kotlin
- audd-dotnet
- audd-java
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.SDK_DISPATCH_APP_ID }}
private-key: ${{ secrets.SDK_DISPATCH_APP_PRIVATE_KEY }}
owner: AudDMusic
repositories: ${{ matrix.sdk }}
- name: Fire repository_dispatch
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
SDK_REPO: ${{ matrix.sdk }}
TRIGGER_SHA: ${{ github.sha }}
TRIGGER_RUN_ID: ${{ github.run_id }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
"/repos/AudDMusic/$SDK_REPO/dispatches" \
-f event_type=openapi-updated \
-f "client_payload[trigger_sha]=$TRIGGER_SHA" \
-f "client_payload[trigger_run_id]=$TRIGGER_RUN_ID"
echo "dispatched openapi-updated to AudDMusic/$SDK_REPO"