Adding blog posts to your GitHub README with GitHub Actions

This article will discuss about adding your blog posts to your Github readme with Github Actions. You can add a README file to a repository to communicate important information about your project. You can find for more details about the GitHub readme from here

I was looking into some automation aspect related to GitHub readme automation – I was looking into some solution using Azure Functions and Logic Apps. And I found few solutions as well. But later I found one simple solution using GitHub Actions. Here is the GitHub Action which will run every day and use your blog RSS feed and update your Readme file.

You can create an GitHub Action and add the following code.

name: Blog posts on ReadMe
on:
schedule:
# Runs every day at 9am UTC
cron: 0 4 * * *’

jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
uses: actions/[email protected]
name: Get RSS Feed
uses: kohrongying/[email protected]
with:
feed_url: https://dotnetthoughts.net/feed
count: 10
name: Commit file changes
run: |
git config –global user.name ‘anuraj’
git config –global user.email ‘[email protected]
git add .
git diff –quiet –cached || git commit -m “Update README”
name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

And here is the screenshot of the GitHub Action running.

And here is the Updated Readme file.

This way you will be able to update your blog posts automatically in to your GitHub readme file with the help of GitHub Actions.

Happy Programming 🙂

Flatlogic Admin Templates banner

Leave a Reply

Your email address will not be published. Required fields are marked *