diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryContext.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryContext.java index 147a1e3f04214a..32bfcb14f98f4d 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryContext.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryContext.java @@ -1032,6 +1032,11 @@ private Checksum calculateChecksum(Optional originalChecksum, Path pat private Optional validateChecksum(String sha256, String integrity, List urls) throws RepositoryFunctionException, EvalException { + if (urls.size() == 1 && urls.get(0).getHost().contains("github.com")) { + // If the URL from Github and we don't have any other URLs from which to pull, we don't need + // to validate the checksum + return Optional.absent(); + } if (!sha256.isEmpty()) { if (!integrity.isEmpty()) { throw Starlark.errorf("Expected either 'sha256' or 'integrity', but not both");