[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$KiqIp5Qu8t":3,"blog-\u002Fblog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile":52,"blogToc-\u002Fblog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile":218,"blog-surrounding-\u002Fblog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile":308,"blog-similar-posts-\u002Fblog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile":317},{"id":4,"extension":5,"items":6,"meta":49,"stem":50,"__hash__":51},"menu\u002Fmenu.json","json",[7,12,16,20,24,28,32,36,41,45],{"i18nId":8,"to":9,"ariaLabel":10,"mainNavigation":11},"components.menu.home","\u002F","Home",true,{"i18nId":13,"to":14,"ariaLabel":15,"mainNavigation":11},"components.menu.about","\u002Fhire-me","About",{"i18nId":17,"to":18,"ariaLabel":19,"mainNavigation":11},"components.menu.testimonials","\u002Ftestimonials","Testimonials",{"i18nId":21,"to":22,"ariaLabel":23},"components.menu.contact","\u002Fcontact","Contact",{"i18nId":25,"to":26,"ariaLabel":27,"mainNavigation":11},"components.menu.blog","\u002Fblog","Blog",{"i18nId":29,"to":30,"ariaLabel":31,"mainNavigation":11},"components.menu.tips","\u002Fvue-tips","Vue Tips",{"i18nId":33,"to":34,"ariaLabel":35,"mainNavigation":11},"components.menu.projects","\u002Fprojects","Projects",{"i18nId":37,"to":38,"ariaLabel":39,"mainNavigation":40},"components.menu.stats","\u002Fstats","stats",false,{"i18nId":42,"to":43,"ariaLabel":44,"mainNavigation":40},"components.menu.businessCard","\u002Fbusiness-card","Business Card",{"i18nId":46,"to":47,"ariaLabel":48,"mainNavigation":40},"components.menu.publications","\u002Fpublications","Publications",{},"menu","njLT1QoRt2Dv8QWoVmH8xdTAiDywSj0bxBQdmoyWUE0",{"id":53,"title":54,"body":55,"categories":197,"cover":119,"date":200,"description":201,"extension":202,"lastUpdated":203,"meta":204,"navigation":11,"ogImage":203,"path":205,"readingTime":206,"robots":203,"schemaOrg":203,"seo":211,"sitemap":212,"stem":216,"tags":203,"__hash__":217},"blog\u002Fblog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile\u002Findex.md","How I Built A Self-Updating README On My Github Profile",{"type":56,"value":57,"toc":190},"minimark",[58,88,93,96,104,111,114,120,123,127,140,143,172,180,184,187],[59,60,61,62,69,70,75,76,81,82,87],"p",{},"On ",[63,64,68],"a",{"href":65,"rel":66},"https:\u002F\u002Fnews.ycombinator.com\u002Fitem?id=23807881",[67],"nofollow","Hacker News"," I discovered the article ",[63,71,74],{"href":72,"rel":73},"https:\u002F\u002Fsimonwillison.net\u002F2020\u002FJul\u002F10\u002Fself-updating-profile-readme\u002F",[67],"Building a self-updating profile README for GitHub",". I was very fascinated about this new ",[63,77,80],{"href":78,"rel":79},"https:\u002F\u002Fgithub.com",[67],"GitHub"," feature and wanted to build something similar for ",[63,83,86],{"href":84,"rel":85},"https:\u002F\u002Fgithub.com\u002FMokkapps",[67],"my GitHub profile",".",[89,90,92],"h2",{"id":91},"github-profile-readme","GitHub Profile README",[59,94,95],{},"GitHub profile READMEs are a new feature that allows users to have the content of a README markdown file rendered at the profile page.",[59,97,98,99,103],{},"To use this feature you just need to create a new repository that has the same name as your GitHub account. Mine is located at ",[100,101,102],"code",{},"github.com\u002Fmokkapps\u002Fmokkapps",".This repository needs to be public and initialized with a README:",[59,105,106],{},[107,108],"img",{"alt":109,"src":110},"Create a new GitHub repository","blog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile\u002Fcreate-repo_abqnnh.jpg",[59,112,113],{},"Now you will see a new section at the top of your profile page which renders the content of this new README file:",[59,115,116],{},[107,117],{"alt":118,"src":119},"Cover Image","blog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile\u002Fcover_y020iu.jpg",[59,121,122],{},"In my example, I am showing five links to the latest blog posts on my website and the latest tweet I published on Twitter. This information is automatically updated and I want to show you how I implemented this functionality.",[89,124,126],{"id":125},"automatically-update-the-readme","Automatically Update The README",[59,128,129,130,135,136,139],{},"All the magic is happening in a GitHub Action defined in ",[63,131,134],{"href":132,"rel":133},"https:\u002F\u002Fgithub.com\u002FMokkapps\u002Fmokkapps\u002Fblob\u002Fmaster\u002F.github\u002Fworkflows\u002Fbuild.yml",[67],"build.yml",". This action runs on every Git push, every 32 minutes past the hour (configured via a cron schedule) or by manually clicking a button in the GitHub Action UI (by using ",[100,137,138],{},"workflow_dispatch"," event).",[59,141,142],{},"The workflow performs these actions:",[144,145,146,156,169],"ol",{},[147,148,149,150,155],"li",{},"Fetches the latest tweet from my Twitter account using the Twitter API, renders it to a PNG using headless Chrome (from an R script) and saves it as PNG which is then embedded in the README (taken from ",[63,151,154],{"href":152,"rel":153},"https:\u002F\u002Fgithub.com\u002Fzhiiiyang",[67],"zhiiiyang",").",[147,157,158,159,162,163,168],{},"Runs a JavaScript script which fetches the five latest blog posts from my RSS feed and generates the final ",[100,160,161],{},"README.md"," (inspired by ",[63,164,167],{"href":165,"rel":166},"https:\u002F\u002Fgithub.com\u002Fsimonw",[67],"simonw",")",[147,170,171],{},"Commits and pushes the changes to the master branch of this repo",[59,173,174,175,87],{},"The JS script is quite simple and has only ",[63,176,179],{"href":177,"rel":178},"https:\u002F\u002Fgithub.com\u002FMokkapps\u002Fmokkapps\u002Fblob\u002Fmaster\u002Findex.js",[67],"~50 lines of code",[89,181,183],{"id":182},"conclusion","Conclusion",[59,185,186],{},"The GitHub profile READMEs are a cool feature and by using GitHub Actions it can help us to provide up-to-date information for profile visitors.",[59,188,189],{},"But most importantly I had a lot of fun building it and this is more important than everything else.",{"title":191,"searchDepth":192,"depth":192,"links":193},"",2,[194,195,196],{"id":91,"depth":192,"text":92},{"id":125,"depth":192,"text":126},{"id":182,"depth":192,"text":183},[198,199],"development","career","2020-07-15","On Hacker News I discovered the article Building a self-updating profile README for GitHub. I was very fascinated about this new GitHub feature and wanted to build something similar for my GitHub profile.","md",null,{},"\u002Fblog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile",{"text":207,"minutes":208,"time":209,"words":210},"2 min read",1.635,98100,327,{"title":54,"description":201},{"loc":205,"images":213,"lastmod":200},[214,215],{"loc":110},{"loc":119},"blog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile\u002Findex","3lRKJpx_mrmq0e4QOVET78hxSnAmspNDHwMxvdsH9LU",{"id":219,"title":54,"body":220,"cover":119,"description":201,"extension":202,"meta":299,"navigation":11,"path":205,"robots":203,"seo":302,"sitemap":303,"stem":216,"__hash__":307},"content\u002Fblog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile\u002Findex.md",{"type":56,"value":221,"toc":294},[222,236,238,240,244,248,250,254,256,258,265,267,283,288,290,292],[59,223,61,224,69,227,75,230,81,233,87],{},[63,225,68],{"href":65,"rel":226},[67],[63,228,74],{"href":72,"rel":229},[67],[63,231,80],{"href":78,"rel":232},[67],[63,234,86],{"href":84,"rel":235},[67],[89,237,92],{"id":91},[59,239,95],{},[59,241,98,242,103],{},[100,243,102],{},[59,245,246],{},[107,247],{"alt":109,"src":110},[59,249,113],{},[59,251,252],{},[107,253],{"alt":118,"src":119},[59,255,122],{},[89,257,126],{"id":125},[59,259,129,260,135,263,139],{},[63,261,134],{"href":132,"rel":262},[67],[100,264,138],{},[59,266,142],{},[144,268,269,274,281],{},[147,270,149,271,155],{},[63,272,154],{"href":152,"rel":273},[67],[147,275,158,276,162,278,168],{},[100,277,161],{},[63,279,167],{"href":165,"rel":280},[67],[147,282,171],{},[59,284,174,285,87],{},[63,286,179],{"href":177,"rel":287},[67],[89,289,183],{"id":182},[59,291,186],{},[59,293,189],{},{"title":191,"searchDepth":192,"depth":192,"links":295},[296,297,298],{"id":91,"depth":192,"text":92},{"id":125,"depth":192,"text":126},{"id":182,"depth":192,"text":183},{"categories":300,"date":200,"readingTime":301},[198,199],{"text":207,"minutes":208,"time":209,"words":210},{"title":54,"description":201},{"loc":205,"images":304,"lastmod":200},[305,306],{"loc":110},{"loc":119},"cYw4-G4EyA2WF6iSg7F7Xx8cd1NiBnqAfutsgA464Pc",[309,313],{"title":310,"path":311,"stem":312,"children":-1},"How To Automatically Generate A Helpful Changelog From Your Git Commit Messages","\u002Fblog\u002Fhow-to-automatically-generate-a-helpful-changelog-from-your-git-commit-messages","blog\u002Fhow-to-automatically-generate-a-helpful-changelog-from-your-git-commit-messages\u002Findex",{"title":314,"path":315,"stem":316,"children":-1},"Property Based Testing With Typescript","\u002Fblog\u002Fproperty-based-testing-with-type-script","blog\u002Fproperty-based-testing-with-type-script\u002Findex",[318,323,328,333],{"cover":319,"date":320,"slug":321,"title":322,"to":321},"blog\u002Fmy-top-react-interview-questions\u002Fcover_usumlz.jpg","2021-06-29","\u002Fblog\u002Fmy-top-react-interview-questions","My Top React Interview Questions",{"cover":324,"date":325,"slug":326,"title":327,"to":326},"blog\u002Fmy-top-vue-js-interview-questions\u002Fcover_pqpvfe.jpg","2021-10-04","\u002Fblog\u002Fmy-top-vue-js-interview-questions","My Top Vue.js Interview Questions",{"cover":329,"date":330,"slug":331,"title":332,"to":331},"blog\u002Fthe-10-favorite-features-of-my-developer-portfolio-website\u002Fcover_ayemj0.jpg","2022-01-07","\u002Fblog\u002Fthe-10-favorite-features-of-my-developer-portfolio-website","The 10 Favorite Features of My Developer Portfolio Website",{"cover":334,"date":335,"slug":336,"title":337,"to":336},"blog\u002Fwhy-i-picked-vue-js-as-my-freelancer-niche\u002Fcover_bpyxsr.jpg","2021-09-22","\u002Fblog\u002Fwhy-i-picked-vue-js-as-my-freelancer-niche","Why I Picked Vue.js as My Freelancer Niche"]