Skip to content

Commit

Permalink
docs: WorkflowTemplate trigger from a sensor example - Fixes #2234
Browse files Browse the repository at this point in the history
Updated example to correctly trigger WorkflowTemplate, using `argoWorkflow` with `submit` operation to reference existing WorkflowTemplate
  • Loading branch information
wesleyscholl authored Nov 16, 2024
1 parent a544eba commit f4c8c4d
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions examples/triggers/workflow-template-trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,14 @@ spec:
triggers:
- template:
name: webhook-workflow-trigger # Trigger Name
k8s:
argoWorkflow:
source:
resource: # Specifying the resource to trigger
apiVersion: argoproj.io/v1alpha1
kind: Workflow
kind: WorkflowTemplate # Specifying the kind
metadata:
generateName: ci-workflow-
spec:
arguments:
parameters:
- name: repo # Parameters to pass to pass to the WorkflowTemplate
- name: branch
- name: name
- name: email
workflowTemplateRef:
name: ci-workflow # Name of the WorkflowTemplate
operation: create # Creates the workflow when triggered
name: ci-workflow # Name of the WorkflowTemplate
operation: submit # Submits the WorkflowTemplate when triggered
parameters:
- src:
dependencyName: github-webhook # Event source dependency
Expand All @@ -47,4 +38,4 @@ spec:
dataKey: body.pusher.email # (GitHub user email)
dest: spec.arguments.parameters.3.value
template:
serviceAccountName: operate-workflow-sa # Service account to use - Required to create workflows
serviceAccountName: operate-workflow-sa # Service account - Required to submit workflows

0 comments on commit f4c8c4d

Please sign in to comment.