[{"data":1,"prerenderedAt":-1,"buildId":338},["ShallowReactive",2],{"$9oPIbGgjrk":3,"blog-\u002Fblog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile":52,"blog-similar-posts-\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":239,"blogToc-\u002Fblog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile":248},{"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",[219,224,229,234],{"cover":220,"date":221,"slug":222,"title":223,"to":222},"blog\u002Fmy-top-react-interview-questions\u002Fcover_usumlz.jpg","2021-06-29","\u002Fblog\u002Fmy-top-react-interview-questions","My Top React Interview Questions",{"cover":225,"date":226,"slug":227,"title":228,"to":227},"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":230,"date":231,"slug":232,"title":233,"to":232},"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":235,"date":236,"slug":237,"title":238,"to":237},"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",[240,244],{"title":241,"path":242,"stem":243,"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":245,"path":246,"stem":247,"children":-1},"Property Based Testing With Typescript","\u002Fblog\u002Fproperty-based-testing-with-type-script","blog\u002Fproperty-based-testing-with-type-script\u002Findex",{"id":249,"title":54,"body":250,"cover":119,"date":200,"description":201,"extension":202,"meta":329,"navigation":11,"path":205,"robots":203,"seo":332,"sitemap":333,"stem":216,"__hash__":337},"content\u002Fblog\u002Fhow-i-built-a-self-updating-readme-on-my-git-hub-profile\u002Findex.md",{"type":56,"value":251,"toc":324},[252,266,268,270,274,278,280,284,286,288,295,297,313,318,320,322],[59,253,61,254,69,257,75,260,81,263,87],{},[63,255,68],{"href":65,"rel":256},[67],[63,258,74],{"href":72,"rel":259},[67],[63,261,80],{"href":78,"rel":262},[67],[63,264,86],{"href":84,"rel":265},[67],[89,267,92],{"id":91},[59,269,95],{},[59,271,98,272,103],{},[100,273,102],{},[59,275,276],{},[107,277],{"alt":109,"src":110},[59,279,113],{},[59,281,282],{},[107,283],{"alt":118,"src":119},[59,285,122],{},[89,287,126],{"id":125},[59,289,129,290,135,293,139],{},[63,291,134],{"href":132,"rel":292},[67],[100,294,138],{},[59,296,142],{},[144,298,299,304,311],{},[147,300,149,301,155],{},[63,302,154],{"href":152,"rel":303},[67],[147,305,158,306,162,308,168],{},[100,307,161],{},[63,309,167],{"href":165,"rel":310},[67],[147,312,171],{},[59,314,174,315,87],{},[63,316,179],{"href":177,"rel":317},[67],[89,319,183],{"id":182},[59,321,186],{},[59,323,189],{},{"title":191,"searchDepth":192,"depth":192,"links":325},[326,327,328],{"id":91,"depth":192,"text":92},{"id":125,"depth":192,"text":126},{"id":182,"depth":192,"text":183},{"categories":330,"readingTime":331},[198,199],{"text":207,"minutes":208,"time":209,"words":210},{"title":54,"description":201},{"loc":205,"images":334,"lastmod":200},[335,336],{"loc":110},{"loc":119},"prWE3sUTI3ZhcAvJ82QfdS2SUlnbFsu7kJTzJeNdNtI","f09a107e-6bfe-401d-aab9-d94cb6f394d2"]