1
1
mirror of https://github.com/primer/css.git synced 2024-11-30 01:04:04 +03:00
css/script/notify

30 lines
749 B
Bash
Executable File

#!/bin/bash
set -e
if [[ "$CI" != "true" ]]; then
echo "(bailing: not in CI)"
exit
elif [[ $# -lt 1 ]]; then
echo "No status provided!" >&2
exit 1
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
_status=$1
version=$(jq -r .version package.json)
name=$(jq -r .name package.json)
# the commit status context
context="npm publish $name"
message="https://unpkg.com/$name@$version/"
echo "📡 Transmitting publish status for $context $name@$version..."
commit-status "$_status" "$context" "$name@$version" "$message"