GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #2098 from github/henrymercer/update-internal-queries · github/codeql-action@bd67d8d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • queries
    • required-action-input.ql
    • undeclared-action-input.ql
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎queries/required-action-input.ql‎

Copy file name to clipboardExpand all lines: queries/required-action-input.ql
+5-16Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,26 @@ class ActionDeclaration extends File {
1919
getRelativePath().matches("%/action.yml")
2020
}
2121

22-
YAMLDocument getRootNode() {
22+
YamlDocument getRootNode() {
2323
result.getFile() = this
2424
}
2525

2626
/**
2727
* The name of any input to this action.
2828
*/
2929
string getAnInput() {
30-
result = getRootNode().(YAMLMapping).lookup("inputs").(YAMLMapping).getKey(_).(YAMLString).getValue()
30+
result = getRootNode().(YamlMapping).lookup("inputs").(YamlMapping).getKey(_).(YamlString).getValue()
3131
}
3232

3333
/**
3434
* The given input always has a value, either because it is required,
3535
* or because it has a default value.
3636
*/
3737
predicate inputAlwaysHasValue(string input) {
38-
exists(YAMLMapping value |
39-
value = getRootNode().(YAMLMapping).lookup("inputs").(YAMLMapping).lookup(input) and
38+
exists(YamlMapping value |
39+
value = getRootNode().(YamlMapping).lookup("inputs").(YamlMapping).lookup(input) and
4040
(exists(value.lookup("default")) or
41-
value.lookup("required").(YAMLBool).getBoolValue() = true))
42-
}
43-
44-
/**
45-
* The function that is the entrypoint to this action.
46-
*/
47-
FunctionDeclStmt getEntrypoint() {
48-
result.getFile().getRelativePath() = getRootNode().
49-
(YAMLMapping).lookup("runs").
50-
(YAMLMapping).lookup("main").
51-
(YAMLString).getValue().regexpReplaceAll("\\.\\./lib/(.*)\\.js", "src/$1.ts") and
52-
result.getName() = "run"
41+
value.lookup("required").(YamlBool).getBoolValue() = true))
5342
}
5443
}
5544

Collapse file

‎queries/undeclared-action-input.ql‎

Copy file name to clipboardExpand all lines: queries/undeclared-action-input.ql
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,25 @@ class ActionDeclaration extends File {
2424
result = getRelativePath().regexpCapture("(.*)/action.yml", 1)
2525
}
2626

27-
YAMLDocument getRootNode() {
27+
YamlDocument getRootNode() {
2828
result.getFile() = this
2929
}
3030

3131
/**
3232
* The name of any input to this action.
3333
*/
3434
string getAnInput() {
35-
result = getRootNode().(YAMLMapping).lookup("inputs").(YAMLMapping).getKey(_).(YAMLString).getValue()
35+
result = getRootNode().(YamlMapping).lookup("inputs").(YamlMapping).getKey(_).(YamlString).getValue()
3636
}
3737

3838
/**
3939
* The function that is the entrypoint to this action.
4040
*/
4141
FunctionDeclStmt getEntrypoint() {
4242
result.getFile().getRelativePath() = getRootNode().
43-
(YAMLMapping).lookup("runs").
44-
(YAMLMapping).lookup("main").
45-
(YAMLString).getValue().regexpReplaceAll("\\.\\./lib/(.*)\\.js", "src/$1.ts") and
43+
(YamlMapping).lookup("runs").
44+
(YamlMapping).lookup("main").
45+
(YamlString).getValue().regexpReplaceAll("\\.\\./lib/(.*)\\.js", "src/$1.ts") and
4646
result.getName() = "run"
4747
}
4848
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.