@@ -51,8 +51,9 @@ results contains poutine.finding(rule, pkg_purl, {
51
51
" path" : workflow_path,
52
52
" line" : step.lines.run,
53
53
" details" : sprintf (" Detected usage of `%s`" , [cmd]),
54
+ " event_triggers" : workflow_events,
54
55
}) if {
55
- [pkg_purl, workflow_path, step] := _steps_after_untrusted_checkout[_]
56
+ [pkg_purl, workflow_path, workflow_events, step] := _steps_after_untrusted_checkout[_]
56
57
regex.match (
57
58
sprintf (" ([^a-z]|^)(%v)" , [concat (" |" , build_commands[cmd])]),
58
59
step.run,
@@ -63,24 +64,27 @@ results contains poutine.finding(rule, pkg_purl, {
63
64
" path" : workflow_path,
64
65
" line" : step.lines.uses,
65
66
" details" : sprintf (" Detected usage the GitHub Action `%s`" , [step.action]),
67
+ " event_triggers" : workflow_events,
66
68
}) if {
67
- [pkg_purl, workflow_path, step] := _steps_after_untrusted_checkout[_]
69
+ [pkg_purl, workflow_path, workflow_events, step] := _steps_after_untrusted_checkout[_]
68
70
build_github_actions[step.action]
69
71
}
70
72
71
- _steps_after_untrusted_checkout contains [pkg.purl, workflow.path, s.step] if {
73
+ _steps_after_untrusted_checkout contains [pkg.purl, workflow.path, events, s.step] if {
72
74
pkg := input.packages[_]
73
75
workflow := pkg.github_actions_workflows[_]
74
76
75
77
utils.filter_workflow_events (workflow, github.events)
76
78
79
+ events := [event | event := workflow.events[i].name]
77
80
pr_checkout := utils.find_pr_checkouts (workflow)[_]
78
81
s := utils.workflow_steps_after (pr_checkout)[_]
79
82
}
80
83
81
- _steps_after_untrusted_checkout contains [pkg_purl, workflow.path, s.step] if {
84
+ _steps_after_untrusted_checkout contains [pkg_purl, workflow.path, events, s.step] if {
82
85
[pkg_purl, workflow] := _workflows_runs_from_pr[_]
83
86
87
+ events := [event | event := workflow.events[i].name]
84
88
pr_checkout := utils.find_pr_checkouts (workflow)[_]
85
89
s := utils.workflow_steps_after (pr_checkout)[_]
86
90
}
@@ -142,17 +146,17 @@ results contains poutine.finding(rule, pkg.purl, {
142
146
" path" : pipeline.path,
143
147
" job" : task.name,
144
148
" step" : step_idx,
145
- " line" : step.lines[ " script" ] ,
149
+ " line" : step.lines. script,
146
150
" details" : sprintf (" Detected usage of `%s`" , [cmd]),
147
151
}) if {
148
- pkg := input.packages[_]
149
- pipeline := pkg.pipeline_as_code_tekton[_]
150
- contains (pipeline.api_version, " tekton.dev" )
151
- pipeline.kind == " PipelineRun"
152
- contains (pipeline.metadata.annotations[" pipelinesascode.tekton.dev/on-event" ], " pull_request" )
153
- contains (pipeline.metadata.annotations[" pipelinesascode.tekton.dev/task" ], " git-clone" )
154
- task := pipeline.spec.pipeline_spec.tasks[_]
155
- step := task.task_spec.steps[step_idx]
152
+ pkg := input.packages[_]
153
+ pipeline := pkg.pipeline_as_code_tekton[_]
154
+ contains (pipeline.api_version, " tekton.dev" )
155
+ pipeline.kind == " PipelineRun"
156
+ contains (pipeline.metadata.annotations[" pipelinesascode.tekton.dev/on-event" ], " pull_request" )
157
+ contains (pipeline.metadata.annotations[" pipelinesascode.tekton.dev/task" ], " git-clone" )
158
+ task := pipeline.spec.pipeline_spec.tasks[_]
159
+ step := task.task_spec.steps[step_idx]
156
160
regex.match (
157
161
sprintf (" ([^a-z]|^)(%v)" , [concat (" |" , build_commands[cmd])]),
158
162
step.script,
0 commit comments