Skip to content

Commit 700eaf5

Browse files
committed
Added JobRunson
1 parent 296c0a7 commit 700eaf5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ module Actions {
9393

9494
/** Gets the value of the `if` field in this job, if any. */
9595
JobIf getIf() { result.getJob() = this }
96+
97+
/** Gets the value of the `runs-on` field in this job. */
98+
JobRunson getRunsOn() { result.getJob() = this }
9699
}
97100

98101
/**
@@ -108,6 +111,20 @@ module Actions {
108111
Job getJob() { result = job }
109112
}
110113

114+
/**
115+
* A `runs-on` within a job.
116+
* See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on.
117+
*/
118+
class JobRunson extends YamlNode, YamlScalar {
119+
Job job;
120+
121+
JobRunson() { job.lookup("runs-on") = this }
122+
123+
/** Gets the step this field belongs to. */
124+
Job getJob() { result = job }
125+
}
126+
127+
111128
/**
112129
* A step within an Actions job.
113130
* See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idsteps.

0 commit comments

Comments
 (0)