diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-07-02 23:59:42 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-07-03 01:01:13 +0200 |
| commit | d6962ffb31d2f06081511884291fa163961a98e6 (patch) | |
| tree | 71598403ab6f8d3296334e0fc5d2b0060a082f6b | |
| parent | 13bdc5c2be5a4a1490a2c777580cd9ad7a097343 (diff) | |
| download | rust-d6962ffb31d2f06081511884291fa163961a98e6.tar.gz rust-d6962ffb31d2f06081511884291fa163961a98e6.zip | |
Only run error code explanation removal check if on CI
| -rwxr-xr-x | src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh | 7 | ||||
| -rwxr-xr-x | src/ci/docker/run.sh | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh b/src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh index d5231ede591..e9aa948eb87 100755 --- a/src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh +++ b/src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh @@ -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..." diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index f6b2cf34313..489c3d76601 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -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 \ |
