Skip to content

Commit

Permalink
Only run error code explanation removal check if on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jul 2, 2021
1 parent 13bdc5c commit d6962ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash
# Checks that no error code explanation is removed.

set -euo pipefail
set -eo pipefail

if [[ -z "$BASE_COMMIT" ]]; then
echo "not checking error code explanations removal"
exit 0
fi

echo "Check if an error code explanation was removed..."

Expand Down
10 changes: 7 additions & 3 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,13 @@ else
command="/checkout/src/ci/run.sh"
fi

# Get some needed information for $BASE_COMMIT
git fetch "https://github.com/$GITHUB_REPOSITORY" "$GITHUB_BASE_REF"
BASE_COMMIT="$(git merge-base FETCH_HEAD HEAD)"
if [ "$CI" != "" ]; then
# Get some needed information for $BASE_COMMIT
git fetch "https://github.com/$GITHUB_REPOSITORY" "$GITHUB_BASE_REF"
BASE_COMMIT="$(git merge-base FETCH_HEAD HEAD)"
else
BASE_COMMIT=""
fi

docker \
run \
Expand Down

0 comments on commit d6962ff

Please sign in to comment.