ci: gh-actions: fix notify
[m6w6/libmemcached] / .github / notify-gitter.sh
1 #!/usr/bin/env bash
2 GITTER=$1
3
4 REPO=${GITHUB_REPOSITORY}
5
6 REF=$(basename ${GITHUB_REF})
7 REF_URL=https://github.com/${REPO}/commits/${REF}
8
9 BUILD_URL=https://github.com/${REPO}/actions/runs/${GITHUB_RUN_ID}
10 BUILD_ENV=${ImageOS}/${CC:-${CC_VND}-${CC_VER}}
11
12 case "$2" in
13 1|true|success)
14 level=info
15 status=success
16 ;;
17 *)
18 level=error
19 status=failure
20 ;;
21 esac
22 message="Github [${REPO}](${REF_URL}) (${REF}) [${status}](${BUILD_URL}) (${BUILD_ENV})"
23
24 curl -sS "${GITTER}" --data-urlencode "level=${level}" --data-urlencode "message=${message}"
25