Skip to content

Commit 483aa06

Browse files
lunnytechknowlogick
authored andcommitted
fix public will not be reused as public key after deleting as deploy key (#5671) (#5684)
1 parent 551dc58 commit 483aa06

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

models/ssh_key.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,11 @@ func DeleteDeployKey(doer *User, id int64) error {
844844
if err = deletePublicKeys(sess, key.KeyID); err != nil {
845845
return err
846846
}
847+
848+
// after deleted the public keys, should rewrite the public keys file
849+
if err = rewriteAllPublicKeys(sess); err != nil {
850+
return err
851+
}
847852
}
848853

849854
return sess.Commit()

0 commit comments

Comments
 (0)