GitHub Action to calculate reading time of Markdown files in the specified folder and add results to a manifest.json
- uses: zentered/reading-time-action
with:
path: docs
Name | Requirement | Default | Description |
---|---|---|---|
path |
optional | docs |
Path where the markdown files and manifest are located |
{
"text": "1 min",
"minutes": 0.475,
"time": 28500,
"words": 95
}
This action does not commit/push to your repo. You can use the github-push-action. Here's a complete example:
name: Reading Time
on:
push:
branches:
- '**'
- '!main'
paths:
- 'docs/**'
jobs:
reading-time:
runs-on: ubuntu-latest
name: calculate reading time
steps:
- uses: actions/checkout@v2
- name: Сalculate reading time
uses: zentered/[email protected]
- name: Commit Manifest
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit docs/manifest.json -m "chore: calculate reading time"
- name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
See CONTRIBUTING.
See LICENSE.