#!/bin/bash set -e if [[ "$CI" != "true" ]]; then echo "(notify bailing: not in CI)" exit elif [[ $# -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: # export TRAVIS_COMMIT=$TRAVIS_PULL_REQUEST_SHA fi echo "📡 Transmitting publish status for $published..." commit-status "$_status" "$context" "$published" "$message"