Monorepo for Tangled tangled.org
814
fork

Configure Feed

Select the types of activity you want to include in your feed.

knotserver: emit event on default branch change

Signed-off-by: Seongmin Lee <git@boltless.me>

authored by

Seongmin Lee and committed by tangled.org 18a23de1 7ea5147d

+20
+20
knotserver/xrpc/set_default_branch.go
··· 9 9 "github.com/bluesky-social/indigo/atproto/syntax" 10 10 "github.com/bluesky-social/indigo/xrpc" 11 11 "tangled.org/core/api/tangled" 12 + "tangled.org/core/knotserver/db" 12 13 "tangled.org/core/knotserver/git" 13 14 "tangled.org/core/rbac" 15 + "tangled.org/core/tid" 14 16 15 17 xrpcerr "tangled.org/core/xrpc/errors" 16 18 ) ··· 87 89 writeError(w, xrpcerr.GitError(err), http.StatusInternalServerError) 88 90 return 89 91 } 92 + 93 + ownerDid := ident.DID.String() 94 + refUpdate := tangled.GitRefUpdate{ 95 + RepoDid: repo.RepoDid, 96 + OwnerDid: &ownerDid, 97 + RepoName: repo.Name, 98 + CommitterDid: actorDid.String(), 99 + } 100 + eventJson, err := json.Marshal(refUpdate) 101 + if err != nil { 102 + return 103 + } 104 + 105 + x.Db.InsertEvent(db.Event{ 106 + Rkey: tid.TID(), 107 + Nsid: tangled.GitRefUpdateNSID, 108 + EventJson: string(eventJson), 109 + }, x.Notifier) 90 110 91 111 w.WriteHeader(http.StatusOK) 92 112 }