mirror of
https://github.com/primer/css.git
synced 2024-12-11 11:16:04 +03:00
31 lines
753 B
Bash
Executable File
31 lines
753 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..."
|
|
pwd
|
|
commit-status "$_status" "$context" "$name@$version" "$message"
|