Skip to content
This repository has been archived by the owner before Nov 9, 2022. It is now read-only.

Use a case instead of if as pattern matching does not work with version of /bin/sh #68

Merged
merged 2 commits into from Apr 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -4,14 +4,18 @@
REF="pull/${DRONE_PULL_REQUEST}/head"

# pull request ref, bitbucket
if [[ $DRONE_REMOTE_URL = "https://bitbucket.org/"* ]]; then
REF="refs/pull-requests/${DRONE_PULL_REQUEST}/from"
fi
# case being used because pattern matching in /bin/sh needs to use case.
case "$DRONE_REMOTE_URL" in
"https://bitbucket.org/"*) REF="refs/pull-requests/${DRONE_PULL_REQUEST}/from" ;;
*) ;;
esac

# pull request ref, gitlab
if [[ $DRONE_COMMIT_REF = "refs/merge-requests/"* ]]; then
REF="refs/merge-requests/${DRONE_PULL_REQUEST}/head"
fi
# case being used because pattern matching in /bin/sh needs to use case.
case "$DRONE_COMMIT_REF" in
"refs/merge-requests/"*) REF="refs/merge-requests/${DRONE_PULL_REQUEST}/head" ;;
*) ;;
esac

FLAGS=""
if [[ ! -z "${PLUGIN_DEPTH}" ]]; then