mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 19:50:30 +00:00
Re-create the listener when GitHub secret is updated
This commit is contained in:
19
hash/hash.go
19
hash/hash.go
@@ -49,3 +49,22 @@ func ComputeTemplateHash(template interface{}) string {
|
||||
|
||||
return rand.SafeEncodeString(fmt.Sprint(hasher.Sum32()))
|
||||
}
|
||||
|
||||
func ComputeCombinedObjectsHash(first any, others ...any) string {
|
||||
hasher := fnv.New32a()
|
||||
|
||||
hasher.Reset()
|
||||
|
||||
printer := spew.ConfigState{
|
||||
Indent: " ",
|
||||
SortKeys: true,
|
||||
DisableMethods: true,
|
||||
SpewKeys: true,
|
||||
}
|
||||
|
||||
for _, obj := range append([]any{first}, others...) {
|
||||
printer.Fprintf(hasher, "%#v", obj)
|
||||
}
|
||||
|
||||
return rand.SafeEncodeString(fmt.Sprint(hasher.Sum32()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user