Skip to content

πŸ—’οΈ Generate a README.md summary & JSON API from your markdown repository

License

Notifications You must be signed in to change notification settings

AnandChowdhary/notes-summary

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—“ Notes Summary GitHub Action

This GitHub Action generates a README.md summary for your notes repository and an api.json JSON API. You can use the workflow to generate a list of items in your repository.

Build CI Release CI Node CI

Some sample repositories that use this workflow:

πŸ‘©β€πŸ’» Getting started

First, setup your repository with this file structure:

β”œβ”€β”€ README.md
β”œβ”€β”€ .github
β”‚   └── workflows
β”‚       └── readme.yml
└── notes
    β”œβ”€β”€ 2019
    β”‚   β”œβ”€β”€ note-name.md
    β”‚   └── another-note-name.md
    └── 2020
        └── a-third-note-name.md

Add the following comment in your README.md file. This will be replaced with a summary of the notes you've participated it:

<!--autogenerated--><!--/autogenerated-->

Finally, create the GitHub Actions workflow in .github/workflows/readme.yml:

name: Readme CI
on:
  # When you push to the `main` branch
  push:
    branches: [main]
  # And optionally, once every day
  schedule:
    - cron: "0 0 * * *"
  # To manually run this workflow
  workflow_dispatch:
jobs:
  summarize:
    name: Update README.md and api.json
    runs-on: ubuntu-latest
    # Don't run this workflow when [skip ci] is passed
    if: "!contains(github.event.head_commit.message, '[skip ci]')"
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          # Fetch full history to figure out created date
          fetch-depth: 0
      - name: Update note summary
        uses: AnandChowdhary/notes-summary@HEAD
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          directory: "notes"

Your README.md file should then contains a summary of the notes in the notes directory:

Screenshot of README.md

πŸ› οΈ Configuration

Property Description Required
token GitHub token Yes
directory Directory Yes
caption JS function No
commitMessage Commit message No
commitEmail Commit email No
commitUsername Commit username No

πŸ“„ License

About

πŸ—’οΈ Generate a README.md summary & JSON API from your markdown repository

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks