diff --git a/internal/infrastructure/postgres/installed_packages.go b/internal/infrastructure/postgres/installed_packages.go index 7f47feb9c..021759411 100644 --- a/internal/infrastructure/postgres/installed_packages.go +++ b/internal/infrastructure/postgres/installed_packages.go @@ -1,6 +1,7 @@ package postgres import ( + "bytes" "context" "encoding/json" "errors" @@ -352,6 +353,10 @@ func auditReplace(ctx context.Context, q *postgresdb.Queries, p storepkg.Install if action != storepkg.ActionApproveUpdate && action != storepkg.ActionRollback { return nil } + // An unchanged authority, including none at all, is not an approval. + if bytes.Equal(current.AcceptedAuthority, accepted) { + return nil + } return insertAudit(ctx, q, "installed_packages", p.Name, "accept_authority", current.AcceptedAuthority, accepted, 0, p.OrgID) }