Merge pull request #10625 from github/henti/ql_jobrunson

Added job.getRunsOn
This commit is contained in:
Henti Smith
2022-09-30 10:19:14 +01:00
committed by GitHub

View File

@@ -93,6 +93,9 @@ module Actions {
/** Gets the value of the `if` field in this job, if any. */ /** Gets the value of the `if` field in this job, if any. */
JobIf getIf() { result.getJob() = this } JobIf getIf() { result.getJob() = this }
/** Gets the value of the `runs-on` field in this job. */
JobRunson getRunsOn() { result.getJob() = this }
} }
/** /**
@@ -108,6 +111,19 @@ module Actions {
Job getJob() { result = job } Job getJob() { result = job }
} }
/**
* A `runs-on` within a job.
* See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on.
*/
class JobRunson extends YamlNode, YamlScalar {
Job job;
JobRunson() { job.lookup("runs-on") = this }
/** Gets the step this field belongs to. */
Job getJob() { result = job }
}
/** /**
* A step within an Actions job. * A step within an Actions job.
* See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idsteps. * See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idsteps.