Skip to content

Commit f5c6905

Browse files
author
Alvaro Muñoz
authored
Merge pull request #13 from GitHubSecurityLab/github_ctx
Improve regexs
2 parents 65b226d + 499c3e7 commit f5c6905

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

ql/lib/codeql/actions/Ast.qll

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,21 @@ class CtxAccessExpr extends ExprAccessExpr {
355355
abstract Expression getRefExpr();
356356
}
357357

358-
private string stepsCtxRegex() { result = "steps\\.([A-Za-z0-9_-]+)\\.outputs\\.([A-Za-z0-9_-]+)" }
358+
private string stepsCtxRegex() {
359+
result = "\\bsteps\\.([A-Za-z0-9_-]+)\\.outputs\\.([A-Za-z0-9_-]+)\\b"
360+
}
359361

360-
private string needsCtxRegex() { result = "needs\\.([A-Za-z0-9_-]+)\\.outputs\\.([A-Za-z0-9_-]+)" }
362+
private string needsCtxRegex() {
363+
result = "\\bneeds\\.([A-Za-z0-9_-]+)\\.outputs\\.([A-Za-z0-9_-]+)\\b"
364+
}
361365

362-
private string jobsCtxRegex() { result = "jobs\\.([A-Za-z0-9_-]+)\\.outputs\\.([A-Za-z0-9_-]+)" }
366+
private string jobsCtxRegex() {
367+
result = "\\bjobs\\.([A-Za-z0-9_-]+)\\.outputs\\.([A-Za-z0-9_-]+)\\b"
368+
}
363369

364-
private string envCtxRegex() { result = "env\\.([A-Za-z0-9_-]+)" }
370+
private string envCtxRegex() { result = "\\benv\\.([A-Za-z0-9_-]+)\\b" }
365371

366-
private string inputsCtxRegex() { result = "inputs\\.([A-Za-z0-9_-]+)" }
372+
private string inputsCtxRegex() { result = "\\binputs\\.([A-Za-z0-9_-]+)\\b" }
367373

368374
/**
369375
* Holds for an expression accesing the `steps` context.

ql/lib/codeql/actions/dataflow/FlowSources.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private class ExternallyDefinedSource extends RemoteFlowSource {
137137
}
138138

139139
/**
140-
* Composite action input sources
140+
* An input for a Composite Action
141141
*/
142142
private class CompositeActionInputSource extends RemoteFlowSource {
143143
CompositeActionStmt c;

0 commit comments

Comments
 (0)