How to Add Your Recently Published Articles to Your GitHub Profile README using GitHub Actions 🤖
Do you want to show off your articles on GitHub? 🤭
If you said YES, Then you're at the right place. By the end of this article, you'll have your latest articles listed on your GitHub Profile README.
💡 If you're new to GitHub Actions, go check out the official documentation.
🤔 How to use this GitHub Action?
Visit your GitHub Profile README repository
You'll need to add the following section to your README.md file
# 📩 Latest Blog Posts // You can name it whatever you want. <!-- BLOG-POST-LIST:START --> <!-- BLOG-POST-LIST:END -->
Now, create a folder
.githubin the root directory & within that directory create another folder named
workflows. Now, inside the
workflowsdirectory create a new YAML file
blog-post-workflow.yml. This is how your folder structure should look like:
.github └───workflows blog-post-workflow.yml
NOTE: If you're struggling in creating a folder in the GitHub repository from a web app then check this .
Add the following content in the
name: Latest blog post workflow on: schedule: # Run workflow automatically # This will make it run every hour - cron: '0 * * * *' # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly workflow_dispatch: jobs: update-readme-with-blog: name: Update this repo's README with latest blog posts runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: gautamkrishnar/blog-post-workflow@master with: # Replace this URL with your rss feed URL/s feed_list: "https://iamdarshshah.hashnode.dev/rss.xml"
Commit your code and wait for your actions to run automatically or here are the steps to trigger it manually:
Now, Click on
Latest blog post workflow:
Then, click on
Run workflowto trigger the GitHub Action:
NOTE: You can add any popular blogging platform's RSS feed URL. (List of Platforms)
This is it! We did it. 🎉
Now, you can check your GitHub Profile README that lists your latest published articles. 🎊
👀This is How it should look
⚙️ If you want to customize your GitHub Action, then have a look at all available options you can provide custom values to.
Thanks, for reading it till the end. 🙏
Hope you find it useful! Let me know your thoughts on this in the comments section. Don't forget to share this article with your friends or colleagues. Feel free to connect with me on any of the platforms below! 🚀
great tutorial !!!!
Darsh Shah, Awesome! Thanks for creating this and writing about it.
Thanks alot for this post. I have just used it now and it feels good.
ps. Rergarding adding a folder to the repository, you can actually do it a very simple way.
When you type in the name of your file: in this case .github/workflow/<name.yml>
You can actually do this by typing: ".github/". As soon as you add the "/" it will be converted to a folder, so you can now type "workflow/" and finally the name of the yml file.
Nice, but doesnt show my last post 😥
my blog: blogdevtrip.hashnode.dev
my github: github.com/rogergcc
name: Latest blog post workflow main yml on: schedule: # Runs every hour - cron: '0 * * * *' jobs: update-readme-with-blog: name: Update this repo's README with latest blog posts yml runs-on: Ubuntu-20.04 steps: - uses: actions/checkout@v2 - uses: gautamkrishnar/blog-post-workflow@master with: feed_list: "https://blogdevtrip.hashnode.dev/rss.xml"
Hey Roger Colque Calcina, Looks like there are some issues with the GitHub action as it's not fetching the complete list of articles from the RSS feed (Even for me this was not working as expected).
Workaround: I have replaced the RSS feed URL with the dev.to feed URL.
Will take out some time to open an issue or even can open an issue for the same.