-
I have the following Sensor: apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: github-pr-comment
spec:
template:
serviceAccountName: argo-workflows-server
dependencies:
- name: pr-comment-dep
eventSourceName: github-argo-event-source
eventName: pr-comment-trigger
filters:
data:
- path: headers.X-Github-Event
type: string
value:
- issue_comment
triggers:
- template:
name: github-argo-template
argoWorkflow:
operation: submit
source:
resource:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: "test"
spec:
entrypoint: main
serviceAccountName: argo-workflows-server
arguments:
parameters:
- name: pr_id
value: ""
- name: comment_body
value: ""
- name: repo_name
value: ""
workflowTemplateRef:
name: ci-template
parameters:
- src:
dependencyName: pr-comment-dep
dataKey: body.issue.number
dest: spec.arguments.parameters.0.value
- src:
dependencyName: pr-comment-dep
dataKey: body.comment.body
dest: spec.arguments.parameters.1.value
- src:
dependencyName: pr-comment-dep
dataKey: body.repository.name
dest: spec.arguments.parameters.2.value
- src:
dependencyName: pr-comment-dep
dataTemplate: "{{ .Input.body.repository.name }}-"
dest: metadata.name
This Sensor is triggered by an EventSource which passes a payload from Github. I'm trying to override the name of the workflow ( I followed the example from Argo but couldn't get it to work. The EventSource pod doesn't show any errors, but the workflow doesn't get triggered. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found the issue: |
Beta Was this translation helpful? Give feedback.
I found the issue:
dataTemplate: "{{ .Input.body.repository.name }}-"
. I needed to remove the-
at the end, sincemetadata.name
can't contain-
.The logs don't say this, but removing it solved the issue.