Skip to content

Commit 018a76b

Browse files
authored
Merge pull request github#9857 from github/henti/new_actions_predicates
Added Workflow.getName and Step.GetId
2 parents bfe9041 + dcc76dd commit 018a76b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

javascript/ql/lib/semmle/javascript/Actions.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ module Actions {
2828
/** Gets the `jobs` mapping from job IDs to job definitions in this workflow. */
2929
YAMLMapping getJobs() { result = this.lookup("jobs") }
3030

31+
/** Gets the name of the workflow. */
32+
string getName() { result = this.lookup("name").(YAMLString).getValue() }
33+
3134
/** Gets the name of the workflow file. */
3235
string getFileName() { result = this.getFile().getBaseName() }
3336

@@ -129,6 +132,9 @@ module Actions {
129132

130133
/** Gets the value of the `if` field in this step, if any. */
131134
StepIf getIf() { result.getStep() = this }
135+
136+
/** Gets the ID of this step, if any. */
137+
string getId() { result = this.lookup("id").(YAMLString).getValue() }
132138
}
133139

134140
/**

0 commit comments

Comments
 (0)