#!/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: # 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"