src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts/RunAutomaticTasks/_tryRunTasks
class RunAutomaticTasks:	private async _tryRunTasks() {
		this._logService.trace('RunAutomaticTasks: Trying to run tasks.');
		// Wait until we have task system info (the extension host and workspace folders are available).
		if (!this._taskService.hasTaskSystemInfo) {
			this._logService.trace('RunAutomaticTasks: Awaiting task system info.');
			await Event.toPromise(Event.once(this._taskService.onDidChangeTaskSystemInfo));
		}

		this._logService.trace('RunAutomaticTasks: Checking if automatic tasks should run.');
		const isFolderAutomaticAllowed = this._storageService.getBoolean(ARE_AUTOMATIC_TASKS_ALLOWED_IN_WORKSPACE, StorageScope.WORKSPACE, undefined);
		await this._workspaceTrustManagementService.workspaceTrustInitialized;
		const isWorkspaceTrusted = this._workspaceTrustManagementService.isWorkspaceTrusted();
		// 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 => {
				const { tasks } = RunAutomaticTasks._findAutoTasks(this._taskService, workspaceTaskResult);
				this._logService.trace(`RunAutomaticTasks: Found ${tasks.length} automatic tasks tasks`);

				if (tasks.length > 0) {
					RunAutomaticTasks._runTasks(this._taskService, tasks);
				}
			});
		}
	}