-
Notifications
You must be signed in to change notification settings - Fork 27
30 lines (28 loc) · 1.19 KB
/
checkLogs.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
name: Webhook Callback
on:
repository_dispatch:
types: checkLogs
jobs:
respond:
name: Calls the callback being passed in
runs-on: ubuntu-latest
steps:
- name: getToken
id: getToken
uses: fjogeleit/http-request-action@master
with:
url: "https://auth.cloud.armory.io/oauth/token"
method: "POST"
customHeaders: '{ "Content-Type": "application/x-www-form-urlencoded" }'
data: 'audience=https://api.cloud.armory.io&grant_type=client_credentials&client_id=${{ secrets.CDAAS_CLIENT_ID }}&client_secret=${{ secrets.CDAAS_CLIENT_SECRET }}'
- name: callCallback
id: callCallback
uses: fjogeleit/http-request-action@master
with:
url: ${{ github.event.client_payload.callbackUri }}
method: 'POST'
bearerToken: ${{ fromJSON(steps.getToken.outputs.response).access_token }}
customHeaders: '{ "Content-Type": "application/json" }'
data: '{ "success": true, "mdMessage": "Webhook successful: no errors found in logs service: ${{ github.event.client_payload.service }}" }'
- name: show http response
run: echo ${{ steps.callCallback.outputs.response }}