Last year, GitHub quietly released a feature that was quickly noticed by the community – profile READMEs. A is a global file for your GitHub profile, which you can set up by creating a public repository whose name is identical to your GitHub username. For instance, as my username is , I created the . profile README README osteel osteel/osteel repository A little box like this one should appear while you add your own: Once the repository is created, add a file with a short description explaining how great you are, and your GitHub profile page will display its content by default: README Neat and simple. As I was for some inspiration, I stumbled upon Simon Willison's , which features some dynamic content like recent work and blog publications. He explained how he used a combination of and Python to achieve this in a , and I decided to do something similar with PHP. browsing examples version GitHub Actions blog post The placeholder The first thing to do is to create a placeholder in the file where the dynamic content will go. Since I wanted to automatically insert the latest publications of my blog, I used the following tags: README <!-- posts --> <!-- /posts --> You might recognise this format; since Markdown files also support HTML, I used some HTML comment tags to make sure they wouldn't show up on my profile page. The PHP script I can't remember the last time I wrote some PHP without a framework; as a result, I had to do a just to get started with a basic PHP script and some Composer dependencies. quick search Turn out it's quite simple! The first step is to initialise the project with the following command: $ composer init From there, I installed to parse my blog's : a lightweight library RSS feed $ composer require dg/rss-php I then added a file at the root of the project, with the following content: posts.php Nothing too complicated here – Composer's is required at the top, allowing me to load the RSS parser to generate a list of blog posts as a string, in Markdown format. autoload The existing content of the file is then loaded into the variable, and the Markdown string is inserted between its and tags with . README $content <!-- posts --> <!-- /posts --> preg_replace Finally, the file's entire content is replaced with the new one, using the function. file_put_contents The GitHub action are a fairly recent addition to GitHub, allowing developers to automate various CI/CD tasks, like running test suites or deploying web services. GitHub Actions They must be defined using YAML format in a folder at the root of the project, and contain a list of steps that they are to execute. .github/workflows Here's mine, which I named : posts.yml Again, nothing too complicated. We first give the action a name, and then define a list of events that should trigger it – pushing some code to the repository, a manual trigger from the interface ( ), or periodically like a cron job (here, every day at midnight). workflow_dispatch We then indicate that the action should run on an Ubuntu image, where it will: ; clone the repository ; instal PHP 7.4 instal the Composer dependencies; run the PHP script; , if any. commit and push the changes That's it! My GitHub profile is now automatically updated every time I publish a new article. Conclusion This was a quick experiment aiming at exploring GitHub Actions, which I expect to use more and more in the future. It was also fun to use PHP as a simple scripting language again, in a procedural way. I've voluntarily left out a few things in order to keep this article short and simple – please refer to for implementation details. the repository This story was originally published on tech.osteel.me . Resources Managing your profile README GitHub Actions This article’s repository GitHub Action: Checkout V2 GitHub Action: Setup PHP GitHub Action: Git Auto Commit