-
Notifications
You must be signed in to change notification settings - Fork 1
32 lines (32 loc) · 1.15 KB
/
trigger-helm-umbrella.yaml
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
name: Trigger Helm Umbrella
on:
workflow_run:
workflows: [pages-build-deployment]
types:
- completed
jobs:
testStatus:
name: Test Status
runs-on: ubuntu-latest
steps:
- name: Echo Workflow Result
run: echo ${{ github.event.workflow_run.conclusion }}
trigger:
name: Trigger Workflows
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
ORG_NAME: BahmniIndiaDistro
REPOSITORY_NAME: helm-umbrella-chart
EVENT_TYPE: bahmniindia-helm-publish-event
steps:
- name: Create repository_dispatch
run: |
trigger_result=$(curl -s -o trigger_response.txt -w "%{http_code}" -X POST -H "Accept: application/vnd.github.v3+json" -H 'authorization: Bearer ${{ secrets.BAHMNI_PAT }}' https://api.github.com/repos/${ORG_NAME}/${REPOSITORY_NAME}/dispatches -d '{"event_type":"'"${EVENT_TYPE}"'"}')
if [ $trigger_result == 204 ];then
echo "Trigger to $ORG_NAME/$REPOSITORY_NAME Success"
else
echo "Trigger to $ORG_NAME/$REPOSITORY_NAME Failed"
cat trigger_response.txt
exit 1
fi