this repo has no description
2
fork

Configure Feed

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

Tweak how data is parsed bc it didnt need an iife also i need to push things to test lmao

+10 -28
+10 -28
cicd/index.js
··· 42 42 const connect = () => { 43 43 const ws = new WebSocket("wss://knot1.tangled.sh/events"); 44 44 ws.addEventListener("message", async (ev) => { 45 - // example data: 46 - // { 47 - // event: { 48 - // $type: "", 49 - // committerDid: "did:plc:4zht3z4caxwrw3dlsybodywc", 50 - // meta: { 51 - // commitCount: { 52 - // byEmail: [{ count: 1, email: "vielle.dev@proton.me" }], 53 - // }, 54 - // isDefaultRef: true, 55 - // langBreakdown: {}, 56 - // }, 57 - // newSha: "d4a994b4f986f1b6b90bbd89f8757ce49c955f03", 58 - // oldSha: "fe24ef62ae9ca66f587cc5c5b14e91675212d526", 59 - // ref: "refs/heads/master", 60 - // repoDid: "did:plc:4zht3z4caxwrw3dlsybodywc", 61 - // repoName: "server-config", 62 - // }, 63 - // nsid: "sh.tangled.git.refUpdate", 64 - // rkey: "3lxuycprda422", 65 - // }; 66 - const data = (() => { 67 - try { 68 - return sh_tangled_git_refUpdate.parse(JSON.parse(ev.data)); 69 - } catch { 70 - return undefined; 71 - } 72 - })(); 45 + let data; 46 + try { 47 + data = sh_tangled_git_refUpdate.parse(JSON.parse(ev.data)); 48 + } catch { 49 + console.log("Could not parse", ev.data); 50 + return undefined; 51 + } 52 + 53 + console.log(data?.repoDid, data?.repoName, data); 54 + 73 55 // fail gracefully if not json 74 56 if (!data) return; 75 57