async function getProperties()

in azure-pipelines-wrapper/azp.js [33:53]


async function getProperties(check_run) {
    var info = getAzDevInfoFromCheckPayload(check_run);
    if (!info){
        return null;
    }
    var connection = await getconnection(info.org);
    var build = await connection.getBuildApi();
    var properties = await build.getBuildProperties(info.projectId, info.buildId);
    console.log(`check_run: ${check_run.id}`);
    console.log(`check_run details_url: ${check_run.details_url}`);
    var result = {};
    if (properties != null && 'value' in properties){
        for (const [key, value] of Object.entries(properties.value)) {
            if ('$value' in value){
                result[key] = value['$value'];
            }
        }
    }

    return result;
}