Skip to content

Commit 476960e

Browse files
authored
Merge pull request #10625 from github/henti/ql_jobrunson
Added job.getRunsOn
2 parents 06ea829 + 074fac8 commit 476960e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 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,19 @@ 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+
111127
/**
112128
* A step within an Actions job.
113129
* See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idsteps.

0 commit comments

Comments
 (0)