Welcome to mirror list, hosted at ThFree Co, Russian Federation.

util.sh « ci « scripts - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d4b09e8a43738dc32c0e2e3fed86f1fa20c6fb12 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash -e

function report_github_status {
    if [ -z "$1" ]; then echo "No status specified. Skipping GitHub manual status report."; return 1; fi;
    if [ -z "$2" ]; then echo "No context specified. Skipping GitHub manual status report."; return 1; fi;
    if [ -z "$3" ]; then echo "No description specified. Skipping GitHub manual status report."; return 1; fi;
    if [ -z "${ghprbActualCommit}" ]; then echo "Not a pull request. Skipping GitHub manual status report."; return 1; fi;
    if [ -z "${GITHUB_STATUS_AUTH_TOKEN}" ]; then echo "No auth token specified. Skipping GitHub manual status report."; return 1; fi;

    wget -qO- --header "Content-Type: application/json" --post-data "{\"state\": \"$1\", \"context\":\"$2\", \"description\": \"$3\", \"target_url\": \"$4\"}" "https://api.github.com/repos/mono/mono/statuses/${ghprbActualCommit}?access_token=${GITHUB_STATUS_AUTH_TOKEN}"
}