Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the
## [UNRELEASED]

- On Linux, the maximum possible value for the `--threads` option now respects the CPU count as specified in `cgroup` files to more accurately reflect the number of available cores when running in containers.
- Update default CodeQL bundle version to 2.16.1. [#2096](https://github.com/github/codeql-action/pull/2096)

## 3.23.1 - 17 Jan 2024

Expand Down
8 changes: 4 additions & 4 deletions lib/defaults.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"bundleVersion": "codeql-bundle-v2.16.0",
"cliVersion": "2.16.0",
"priorBundleVersion": "codeql-bundle-v2.15.5",
"priorCliVersion": "2.15.5"
"bundleVersion": "codeql-bundle-v2.16.1",
"cliVersion": "2.16.1",
"priorBundleVersion": "codeql-bundle-v2.16.0",
"priorCliVersion": "2.16.0"
}
21 changes: 5 additions & 16 deletions queries/required-action-input.ql
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,26 @@ class ActionDeclaration extends File {
getRelativePath().matches("%/action.yml")
}

YAMLDocument getRootNode() {
YamlDocument getRootNode() {
result.getFile() = this
}

/**
* The name of any input to this action.
*/
string getAnInput() {
result = getRootNode().(YAMLMapping).lookup("inputs").(YAMLMapping).getKey(_).(YAMLString).getValue()
result = getRootNode().(YamlMapping).lookup("inputs").(YamlMapping).getKey(_).(YamlString).getValue()
}

/**
* The given input always has a value, either because it is required,
* or because it has a default value.
*/
predicate inputAlwaysHasValue(string input) {
exists(YAMLMapping value |
value = getRootNode().(YAMLMapping).lookup("inputs").(YAMLMapping).lookup(input) and
exists(YamlMapping value |
value = getRootNode().(YamlMapping).lookup("inputs").(YamlMapping).lookup(input) and
(exists(value.lookup("default")) or
value.lookup("required").(YAMLBool).getBoolValue() = true))
}

/**
* The function that is the entrypoint to this action.
*/
FunctionDeclStmt getEntrypoint() {
result.getFile().getRelativePath() = getRootNode().
(YAMLMapping).lookup("runs").
(YAMLMapping).lookup("main").
(YAMLString).getValue().regexpReplaceAll("\\.\\./lib/(.*)\\.js", "src/$1.ts") and
result.getName() = "run"
value.lookup("required").(YamlBool).getBoolValue() = true))
}
}

Expand Down
10 changes: 5 additions & 5 deletions queries/undeclared-action-input.ql
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ class ActionDeclaration extends File {
result = getRelativePath().regexpCapture("(.*)/action.yml", 1)
}

YAMLDocument getRootNode() {
YamlDocument getRootNode() {
result.getFile() = this
}

/**
* The name of any input to this action.
*/
string getAnInput() {
result = getRootNode().(YAMLMapping).lookup("inputs").(YAMLMapping).getKey(_).(YAMLString).getValue()
result = getRootNode().(YamlMapping).lookup("inputs").(YamlMapping).getKey(_).(YamlString).getValue()
}

/**
* The function that is the entrypoint to this action.
*/
FunctionDeclStmt getEntrypoint() {
result.getFile().getRelativePath() = getRootNode().
(YAMLMapping).lookup("runs").
(YAMLMapping).lookup("main").
(YAMLString).getValue().regexpReplaceAll("\\.\\./lib/(.*)\\.js", "src/$1.ts") and
(YamlMapping).lookup("runs").
(YamlMapping).lookup("main").
(YamlString).getValue().regexpReplaceAll("\\.\\./lib/(.*)\\.js", "src/$1.ts") and
result.getName() = "run"
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/defaults.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"bundleVersion": "codeql-bundle-v2.16.0",
"cliVersion": "2.16.0",
"priorBundleVersion": "codeql-bundle-v2.15.5",
"priorCliVersion": "2.15.5"
"bundleVersion": "codeql-bundle-v2.16.1",
"cliVersion": "2.16.1",
"priorBundleVersion": "codeql-bundle-v2.16.0",
"priorCliVersion": "2.16.0"
}