def METHOD_NAME(conn, event):
    job_id = event['job_id']
    jobs = execute_sql(conn, '''
        SELECT id, state, name, project_id, build_id
        FROM job
        WHERE id = %s
    ''', [job_id])
    if not jobs:
        return False
    job = jobs[0]
    project_id = job['project_id']
    build_id = job['build_id']
    projects = execute_sql(conn, '''
        SELECT id, name, type
        FROM project
        WHERE id = %s
    ''', [project_id])
    if not projects:
        return False
    project = projects[0]
    if project['type'] != 'github':
        return False
    builds = execute_sql(conn, '''
        SELECT id, build_number, restart_counter, commit_id
        FROM build
        WHERE id = %s
    ''', [build_id])
    if not builds:
        return False
    build = builds[0]
    project_name = project['name']
    job_state = job['state']
    job_name = job['name']
    commit_sha = build['commit_id']
    build_id = build['id']
    build_number = build['build_number']
    build_restartCounter = build['restart_counter']
    # determine github commit state
    state = 'success'
    if job_state in ('scheduled', 'running', 'queued'):
        state = 'pending'
    if job_state in ('failure', 'skipped', 'killed', 'unstable'):
        state = 'failure'
    if job_state == 'error':
        state = 'error'
    logger.info("")
    logger.info("Handle job %s", job_id)
    logger.info("Setting jobs %s state to %s", job_id, state)
    token = execute_sql(conn, '''
        SELECT github_api_token FROM "user" u
        INNER JOIN collaborator co
            ON co.role = 'Owner'
            AND co.project_id = %s
            AND co.user_id = u.id
    ''', [project_id])
    if not token:
        logger.warn("No API token, not updating status")
        return False
    github_api_token = token[0]['github_api_token']
    github_status_url = execute_sql(conn, '''
        SELECT github_status_url
        FROM "commit"
        WHERE id = %s
        AND project_id = %s
    ''', [commit_sha, project_id])[0]['github_status_url']
    ha_mode = os.environ.get('INFRABOX_HA_ENABLED') == 'true'
    if ha_mode:
        dashboard_url = get_root_url('global')
    else:
        dashboard_url = execute_sql(conn, '''
                    SELECT root_url
                    FROM cluster
                    WHERE name = 'master'
                ''', [])[0]['root_url']
    target_url = '%s/dashboard/#/project/%s/build/%s/%s/job/%s' % (dashboard_url,
                                                                   urllib.parse.quote(project_name, safe=''),
                                                                   build_number,
                                                                   build_restartCounter,
                                                                   urllib.parse.quote_plus(job_name).replace('+', '%20'))
    job_name = job_name.split(".")[0]
    payload = {
        "state": state,
        "target_url": target_url,
        "description": "project_id:%s job_id:%s" % (project_id, job_id),
        "context": "Job: %s" % job_name
    }
    headers = {
        "Authorization": "token " + github_api_token,
        "User-Agent": "InfraBox"
    }
    # TODO(ib-steffen): support ca bundles
    try:
        r = requests.post(github_status_url,
                          data=json.dumps(payload),
                          headers=headers,
                          timeout=10,
                          verify=False)
        if r.status_code != 201:
            logger.warn("[job: %s] Failed to update github status: %s", job_id, r.text)
            logger.warn(github_status_url)
        else:
            logger.info("[job: %s] Successfully updated github status", job_id)
    except Exception as e:
        logger.warn("[job: %s] Failed to update github status: %s", job_id, e)
        return False
    return True