Skip to content

Commit 922ae57

Browse files
author
Alvaro Muñoz
committed
Fix LabelIf ControlCheck so that it recognizes checks not at the beginning of the expression
1 parent d8f7981 commit 922ae57

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ql/lib/codeql/actions/security/ControlChecks.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class LabelIfCheck extends LabelCheck instanceof If {
165165
condition = normalizeExpr(this.getCondition()) and
166166
(
167167
// eg: contains(github.event.pull_request.labels.*.name, 'safe to test')
168-
condition.regexpMatch("(^|[^!])contains\\(\\s*github\\.event\\.pull_request\\.labels\\b.*")
168+
condition.regexpMatch(".*(^|[^!])contains\\(\\s*github\\.event\\.pull_request\\.labels\\b.*")
169169
or
170170
// eg: github.event.label.name == 'safe to test'
171171
condition.regexpMatch(".*\\bgithub\\.event\\.label\\.name\\s*==.*")

0 commit comments

Comments
 (0)