mirror of
https://github.com/primer/css.git
synced 2024-12-26 15:43:59 +03:00
30 lines
724 B
Bash
Executable File
30 lines
724 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="$name@$version"
|
|
message="https://unpkg.com/$name@$version/"
|
|
|
|
echo "📡 Transmitting publish status for $context..."
|
|
commit-status "$_status" "$context" "publish" "$message"
|