Always update Travis IP addresses before checking
@@ -75,6 +75,11 @@ func (gc *githubChecker) handleCheck(w http.ResponseWriter, r *http.Request) {
func (gc *githubChecker) validateCheckRequest(ctx context.Context, w http.ResponseWriter, r *http.Request, owner, repo string) bool {
log.Infof(ctx, "Remote Addr: %s", r.RemoteAddr)
+ // Always update Travis IP Addresss before checking IP to reduce the # of
+ // flaky errors.
+ if err := ciutil.UpdateTravisCIIPAddrs(urlfetch.Client(ctx)); err != nil {
+ log.Errorf(ctx, "failed to update travis CI IP addresses: %v", err)
+ }
if ciutil.IsFromCI(r) {
// Skip token validation if it's from trusted CI providers.
return true
