-
Notifications
You must be signed in to change notification settings - Fork 102
35 lines (31 loc) · 1.1 KB
/
12-run-workflow.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
name: 12 - Run Workflow
on:
workflow_run:
workflows: ["12 - Workflow Tester"]
types: [completed] #requested
jobs:
on-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- run: echo "First workflow was a success"
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: |
echo "First workflow was a failure"
echo "Let's dispatch another event for backup"
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": "Start Dispatch Event Workflow", "client_payload": { "repository": "'"$GITHUB_REPOSITORY"'" }}'
test:
runs-on: ubuntu-latest
steps:
- name: Show workflow_run
env:
WORKFLOW_CONTEXT: ${{ toJSON(github.event.workflow_run) }}
run: |
echo ${{ github.event.workflow_run }}
echo $WORKFLOW_CONTEXT