src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts/RunAutomaticTasks/tryRunTasks
class RunAutomaticTasks:	private async tryRunTasks() {
		// Wait until we have task system info (the extension host and workspace folders are available).
		if (!this.taskService.hasTaskSystemInfo) {
			await Event.toPromise(Event.once(this.taskService.onDidChangeTaskSystemInfo));
		}
		const isFolderAutomaticAllowed = this.storageService.getBoolean(ARE_AUTOMATIC_TASKS_ALLOWED_IN_WORKSPACE, StorageScope.WORKSPACE, undefined);
		const isWorkspaceTrusted = this.workspaceTrustManagementService.isWorkpaceTrusted();
		// Only run if allowed. Prompting for permission occurs when a user first tries to run a task.
		if (isFolderAutomaticAllowed && isWorkspaceTrusted) {
			this.taskService.getWorkspaceTasks(TaskRunSource.FolderOpen).then(workspaceTaskResult => {
				let { tasks } = RunAutomaticTasks.findAutoTasks(this.taskService, workspaceTaskResult);
				if (tasks.length > 0) {
					RunAutomaticTasks.runTasks(this.taskService, tasks);
				}
			});
		}
	}