-
Notifications
You must be signed in to change notification settings - Fork 3
38 lines (31 loc) · 1.62 KB
/
6-formulas-scheduler-remote-dispatch.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
37
38
name: 6 - Formulas Scheduler (Remote Dispatch)
on: [repository_dispatch]
jobs:
expected-event:
runs-on: ubuntu-latest
if: github.event.action == 'Start Formula Workflow'
steps:
- name: Event Information
run: |
echo "Event '${{ github.event.action }}' received from '${{ github.event.client_payload.repository }}'"
- name: Ritchie Installation & Initialization
run: |
curl -fsSL https://commons-repo.ritchiecli.io/install.sh | bash
echo '{"addCommons":false, "sendMetrics":false, "runType":"local"}' | rit init --stdin
- name: Ritchie Formula Hello World (Golang) Execution
run: |
rit add repo --provider="Github" --name="demo" --repoUrl="https://github.com/ZupIT/ritchie-formulas-demo" --priority=1
rit demo hello-world --rit_input_text="Dennis" --rit_input_boolean=true --rit_input_list="everything" --rit_input_password="Ritchie"
- name: RESPONSE - Dispatch response event to INIT repository
run: |
curl -X POST https://api.github.com/repos/GuillaumeFalourd/poc-github-actions/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.ACCESS_TOKEN }} \
--data '{"event_type": "Formula Workflow Response", "client_payload": { "repository": "'"$GITHUB_REPOSITORY"'" }}'
unexpected-event:
runs-on: ubuntu-latest
if: github.event.action != 'Start Formula Workflow'
steps:
- name: Event Information
run: |
echo "Unexpected event '${{ github.event.action }}' received from '${{ github.event.client_payload.repository }}'"