mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Js/Yaml: add getFile() predicate
This commit is contained in:
@@ -32,7 +32,7 @@ module Actions {
|
||||
string getName() { result = this.lookup("name").(YamlString).getValue() }
|
||||
|
||||
/** Gets the name of the workflow file. */
|
||||
string getFileName() { result = this.getLocation().getFile().getBaseName() }
|
||||
string getFileName() { result = this.getFile().getBaseName() }
|
||||
|
||||
/** Gets the `on:` in this workflow. */
|
||||
On getOn() { result = this.lookup("on") }
|
||||
|
||||
@@ -15,7 +15,7 @@ private module ServerLess {
|
||||
* `codeURI` defaults to the empty string if no explicit value is set in the configuration.
|
||||
*/
|
||||
private predicate hasServerlessHandler(File ymlFile, string handler, string codeUri) {
|
||||
exists(YamlMapping resource | ymlFile = resource.getLocation().getFile() |
|
||||
exists(YamlMapping resource | ymlFile = resource.getFile() |
|
||||
// There exists at least "AWS::Serverless::Function" and "Aliyun::Serverless::Function"
|
||||
resource.lookup("Type").(YamlScalar).getValue().regexpMatch(".*::Serverless::Function") and
|
||||
exists(YamlMapping properties | properties = resource.lookup("Properties") |
|
||||
|
||||
@@ -62,7 +62,7 @@ module ESLint {
|
||||
/** An `.eslintrc.yaml` file. */
|
||||
private class EslintrcYaml extends Configuration instanceof YamlMapping {
|
||||
EslintrcYaml() {
|
||||
exists(string n | n = this.getFile().getBaseName() |
|
||||
exists(string n | n = getFile().getBaseName() |
|
||||
n = ".eslintrc.yaml" or n = ".eslintrc.yml" or n = ".eslintrc"
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user