func takeAction(log *logrus.Entry, ghc githubClient, org, repo string, num int, author string, hasLabel, verifiable bool) error {
	if !verifiable && !hasLabel {
		if err := ghc.AddLabel(org, repo, num, verifyLabel); err != nil {
			log.WithError(err).Errorf("Failed to add %q label.", verifyLabel)
		}
		msg := plugins.FormatSimpleResponse(author, "Version Mismatch")
		return ghc.CreateComment(org, repo, num, msg)
	} else if verifiable && hasLabel {
		// remove label and prune comment
		if err := ghc.RemoveLabel(org, repo, num, "Version Mismatch"); err != nil {
			log.WithError(err).Errorf("Failed to remove %q label.", "")
		}
		botName, err := ghc.BotName()
		if err != nil {
			return err
		}
		return ghc.DeleteStaleComments(org, repo, num, nil, shouldPrune(botName))
	}
	return nil
}
// takeAction adds or removes the "preliminary_verified" label based on the current
// state of the PR (hasLabel and isVerified). It also handles adding and
// removing GitHub comments notifying the PR author that the request has been verified
takeAction adds or removes the "preliminary_verified" label based on the current
state of the PR (hasLabel and isVerified). It also handles adding and
removing GitHub comments notifying the PR author that the request has been verified
// takeAction adds or removes the " preliminary_verified " label based on the current // state of the PR ( hasLabel and isVerified ) . It also handles adding and // removing GitHub comments notifying the PR author that the request has been verified
func takeAction(log *logrus.Entry, ghc githubClient, org, repo string, num int, author string, hasLabel, verifiable bool) error {
	if !verifiable && !hasLabel {
		if err := ghc.AddLabel(org, repo, num, verifyLabel); err != nil {
			log.WithError(err).Errorf("Failed to add %q label.", verifyLabel)
		}
		msg := plugins.FormatSimpleResponse(author, "Version Mismatch")
		return ghc.CreateComment(org, repo, num, msg)
	} else if verifiable && hasLabel {
		if err := ghc.RemoveLabel(org, repo, num, "Version Mismatch"); err != nil {
			log.WithError(err).Errorf("Failed to remove %q label.", "")
		}
		botName, err := ghc.BotName()
		if err != nil {
			return err
		}
		return ghc.DeleteStaleComments(org, repo, num, nil, shouldPrune(botName))
	}
	return nil
}
func takeAction ( log * logrus . Entry , ghc githubClient , org , repo string , num int , author string , hasLabel , verifiable bool ) error { if ! verifiable && ! hasLabel { if err := ghc . AddLabel ( org , repo , num , verifyLabel ) ; err != nil { log . WithError ( err ) . Errorf ( " " , verifyLabel ) } msg := plugins . FormatSimpleResponse ( author , " " ) return ghc . CreateComment ( org , repo , num , msg ) } else if verifiable && hasLabel { if err := ghc . RemoveLabel ( org , repo , num , " " ) ; err != nil { log . WithError ( err ) . Errorf ( " " , " " ) } botName , err := ghc . BotName ( ) if err != nil { return err } return ghc . DeleteStaleComments ( org , repo , num , nil , shouldPrune ( botName ) ) } return nil }
takeAction adds or removes the "preliminary_verified" label based on the current
state of the PR (hasLabel and isVerified).
takeAction adds or removes the " preliminary_verified " label based on the current state of the PR ( hasLabel and isVerified ) .
// remove label and prune comment