Skip to content

Commit 0b84b5e

Browse files
lunnytechknowlogick
authored andcommitted
fix public will not be reused as public key after deleting as deploy key (#5671)
1 parent 530c2b8 commit 0b84b5e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

models/ssh_key.go

+5
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)