41
extensions/eda/rulebooks/problem_matcher.yml
Normal file
41
extensions/eda/rulebooks/problem_matcher.yml
Normal file
@ -0,0 +1,41 @@
|
||||
---
|
||||
|
||||
- name: Inbound Webhook
|
||||
hosts: localhost
|
||||
match_multiple_rules: true
|
||||
|
||||
sources:
|
||||
- name: Webhook
|
||||
ansible.eda.webhook:
|
||||
host: 0.0.0.0
|
||||
port: "{{ PROBLEM_MATCHER_PORT | default(5000) | int }}"
|
||||
token: "{{ PROBLEM_MATCHER_TOKEN | default('-not-set-') }}"
|
||||
|
||||
rules:
|
||||
|
||||
|
||||
- name: Show workflow_job Action
|
||||
condition: >
|
||||
event.meta.headers['X-GitHub-Event'] == 'workflow_job'
|
||||
actions:
|
||||
|
||||
- debug:
|
||||
msg: |-
|
||||
Received workflow_job event from {{ event.payload.sender.username + ' ' -}}
|
||||
for repository {{ event.payload.repository.full_name + ' ' -}}
|
||||
with action of {{ event.payload.action }}
|
||||
|
||||
|
||||
- name: Process Completed workflow_job
|
||||
condition: >
|
||||
event.meta.headers['X-GitHub-Event'] == 'workflow_job'
|
||||
and
|
||||
event.payload.action == 'completed'
|
||||
actions:
|
||||
|
||||
- run_playbook:
|
||||
name: nofusscomputing.git_events.problem_matcher
|
||||
verbosity: 2
|
||||
extra_vars:
|
||||
payload: "{{ event.payload }}"
|
||||
ansible_connection: local
|
Reference in New Issue
Block a user