1
1
mirror of https://github.com/primer/css.git synced 2024-11-10 16:07:25 +03:00
css/script/notify
2017-07-20 17:01:47 -07:00

33 lines
865 B
Bash
Executable File

#!/bin/bash
set -e
if [[ $# -lt 1 ]]; then
echo "No status provided!" >&2
exit 1
fi
# the commit status context
context="npm publish"
_status=$1
# get the published version of primer-css from its package.json
package=primer-css
version=$(jq -r .version modules/$package/package.json)
published="$package@$version"
message=""
if [[ "$_status" = "success" ]]; then
# TODO point this at the contributing docs!
message="https://unpkg.com/$published/build/build.css"
fi
# XXX this will go away if we build pushes instead of PRs
if [[ "$TRAVIS_PULL_REQUEST_SHA" != "" ]]; then
# setting TRAVIS_COMMIT inline here is a fix for:
# <https://github.com/taskworld/commit-status/issues/5>
export TRAVIS_COMMIT=$TRAVIS_PULL_REQUEST_SHA
fi
echo "📡 Transmitting publish status for $published..."
commit-status "$_status" "$context" "$published" "$message"