Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Correctly Sanitize git Branch and Tag Names #8885

Merged
merged 3 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cicd/docker-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ echo '+++ :evergreen_tree: Configuring Environment'
REPO='eosio/ci-contracts-builder'
PREFIX='base-ubuntu-18.04'
IMAGE="$REPO:$PREFIX-$BUILDKITE_COMMIT-$PLATFORM_TYPE"
SANITIZED_BRANCH=$(echo "$BUILDKITE_BRANCH" | tr '/' '_')
SANITIZED_TAG=$(echo "$BUILDKITE_TAG" | tr '/' '_')
SANITIZED_BRANCH=$(echo "$BUILDKITE_BRANCH" | sed 's.^/..' | tr '/' '_')
SANITIZED_TAG=$(echo "$BUILDKITE_TAG" | sed 's.^/..' | tr '/' '_')
echo '+++ :arrow_down: Pulling Container'
echo "Pulling \"$IMAGE\""
docker pull "$IMAGE"
Expand Down
2 changes: 1 addition & 1 deletion .cicd/installation-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eo pipefail
. ./.cicd/helpers/general.sh
export ENABLE_INSTALL=true
export BRANCH=$(echo $BUILDKITE_BRANCH | sed 's/\//\_/')
export BRANCH=$(echo $BUILDKITE_BRANCH | sed 's.^/..' | tr '/' '_')
export CONTRACTS_BUILDER_TAG="eosio/ci-contracts-builder:base-ubuntu-18.04"
export ARGS="--name ci-contracts-builder-$BUILDKITE_PIPELINE_SLUG-$BUILDKITE_BUILD_NUMBER --init -v $(pwd):$MOUNTED_DIR"
$CICD_DIR/build.sh
Expand Down
4 changes: 2 additions & 2 deletions .cicd/submodule-regression-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ declare -A BASE_MAP

if [[ $BUILDKITE == true ]]; then
[[ -z $BUILDKITE_PULL_REQUEST_BASE_BRANCH ]] && echo "Unable to find BUILDKITE_PULL_REQUEST_BASE_BRANCH ENV. Skipping submodule regression check." && exit 0
BASE_BRANCH=$BUILDKITE_PULL_REQUEST_BASE_BRANCH
CURRENT_BRANCH=$BUILDKITE_BRANCH
BASE_BRANCH="$(echo "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" | sed 's.^/..')"
CURRENT_BRANCH="$(echo "$BUILDKITE_BRANCH" | sed 's.^/..')"
else
[[ -z $GITHUB_BASE_REF ]] && echo "Cannot find \$GITHUB_BASE_REF, so we have nothing to compare submodules to. Skipping submodule regression check." && exit 0
BASE_BRANCH=$GITHUB_BASE_REF
Expand Down