Skip to content

GitHub action to fetch and display your latest blog from Hashnode in a visually pleasing manner

License

Notifications You must be signed in to change notification settings

Sachin-chaurasiya/hashnode-blog-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Hashnode Blog GitHub Action - Latest Hashnode Public API Support

GitHub action to fetch and display your latest blog from Hashnode in a visually pleasing manner

GitHub Super-Linter CI Check dist/ CodeQL

⚙️ Configuration

Option Description Default Required
HASHNODE_PUBLICATION_NAME Your hashnode publication name, Example: blog.hashnode.dev null true
POST_COUNT Number of posts count 6 false
FORMAT Output format (table, list, card, stacked) table false
FILE Filename to save the output README.md false
DEBUG Debug mode false false

🚀 Usage

Step 1: Include the following content in your README.md or any file for display

## My Latest Blog Posts 👇

<!-- HASHNODE_BLOG:START -->
<!-- HASHNODE_BLOG:END -->

Step 2: Configure The Workflow

name: 'Hashnode Blogs'

on:
  workflow_dispatch:
  schedule:
    - cron: '0 0 * * *' # Runs Every Day

jobs:
  update_blogs:
    name: 'Hashnode Latest Blogs'
    runs-on: ubuntu-latest
    steps:
      - name: 'Fetch Repository Contents'
        uses: actions/checkout@main

      - name: 'Hashnode Blog Action'
        uses: 'Sachin-chaurasiya/hashnode-blog-action@main'
        with:
          HASHNODE_PUBLICATION_NAME: 'blog.hashnode.dev'
          POST_COUNT: 6
          FORMAT: 'list'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Table

Table View

List

List View

Card

Card View

Stacked

image

Local Development

Step1 : Fork and clone the repository

git clone https://github.com/<your-name>/hashnode-blog-action.git

cd hashnode-blog-action

Step2: Install the dependencies

npm install

Step3: Make your changes

Step4: Adding tests (if applicable)

Add unit test for your changes tests

Step5: Run the checks and package your changes

The below command will

  • Format your code
  • Lint your code
  • Run the unit tests and coverage
  • And Finally bundle everything
npm run all

Step6: Raise a PR for your contribution

git add .
git commit -m "meaningful commit message"
git push <branch_name>

🛡️ License

Hashnode blog action is licensed under the MIT License - see the LICENSE file for details.

Contributors

We ❤️ all contributions, big and small! Check out our CONTRIBUTING guide to get started and let us know how we can help.

Don't want to miss anything? Give the project a ⭐ 🚀

A HUGE THANK YOU to all our supporters!

Stargazers

Stargazers of hashnode-blog-action

Contributors