Code Monkey home page Code Monkey logo

readme-scribe's Introduction

readme-scribe

A GitHub Action that automatically generates & updates markdown content (like your README.md)

Instructions

  1. Create a markscribe template and place it anywhere in a repository that you automatically want to update. In this guide we will use templates/README.md.tpl.

You can find an example template that I use to automatically update my GitHub profile here: https://github.com/muesli/markscribe/blob/master/templates/github-profile.tpl

  1. In order to access some of GitHub's API, you need to provide a valid GitHub token as a secret called PERSONAL_GITHUB_TOKEN. You can create a new token by going to your profile settings:

Developer settings > Personal access tokens > Generate new token

Depending on your template you will need access to different API scopes. If you want to support the full set of features, tick the checkboxes next to these scopes: read:user, repo:status, public_repo, read:org. Check out the markscribe documentation for a detailed list of required scopes for each individual template function.

Now create a new secret in your repository's Settings and enter that token.

  1. Create a new GitHub workflow in your repository: .github/workflows/readme-scribe.yml
name: Update README

on:
  push:
  schedule:
    - cron: "0 */1 * * *"

jobs:
  markscribe:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@master

      - uses: muesli/readme-scribe@master
        env:
          GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
        with:
          template: "templates/README.md.tpl"
          writeTo: "README.md"

      - uses: stefanzweifel/git-auto-commit-action@v4
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          commit_message: Update generated README
          branch: main
          commit_user_name: readme-scribe ๐Ÿค–
          commit_user_email: [email protected]
          commit_author: readme-scribe ๐Ÿค– <[email protected]>

Careful: if you use master instead of main as the default branch, you will need to update the above config for git-auto-commit-action accordingly.

This action will be triggered once per hour, parses templates/README.md.tpl and generates a new README.md for you, and eventually pushes the changes to the master branch. Make sure to adjust the input values template and writeTo to suit your needs.

Example output

readme-scribe example output

readme-scribe's People

Contributors

muesli avatar jetzlstorfer avatar arthurlutz avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.