GithubHelp home page GithubHelp logo

read-action's Introduction

read-action

This GitHub action tracks the books that you've read by creating a .md file in your repository. This is heavily based on Katy Decorah's read-action

Create an issue with the book's amazon link. The action fetches the product's data and adds a .md file under content/reading (I'm using Hugo to track this!) under your repository.

Setup

Create .github/workflows/read.yml file using the following template:

  issues:
    types: opened

jobs:
  update_library:
    runs-on: macOS-latest
    name: Read
    # only continue if issue has "read" label
    if: contains( github.event.issue.labels.*.name, 'read')
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Read
        uses: johnke/[email protected]
      - name: Commit files
        run: |
          git config --local user.email "[email protected]"
          git config --local user.name "GitHub Action"
          git add -A && git commit -m "Updated _data/read.yml"
          git push "https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git" HEAD:${GITHUB_REF}
      - name: Close issue
        uses: peter-evans/close-issue@v1
        with:
          issue-number: "${{ env.IssueNumber }}"
          comment: "๐Ÿ“š You read ${{ env.BookTitle }} on ${{env.DateRead}}."

Options

readFileName: The file where you want to save your books. Default: _data/read.yml.
providers: Specify the ISBN providers that you want to use, in the order you need them to be invoked. If setting more than one provider, separate each with a comma.

Creating an issue

The title of your issue must start with the Amazon URL of the book, followed by a numerical score from 1-5:

https://www.amazon.co.uk/Sandman-30th-Anniversary-Preludes-Nocturnes/dp/1401284779/ 4

The action will automatically set the date that you finished the book (dateFinished) to today. To specify a different date that you finished the book, add the date after the score in YYYYMMDD format.

https://www.amazon.co.uk/Sandman-30th-Anniversary-Preludes-Nocturnes/dp/1401284779/ 4 20210823

If you add content to the body of the comment, the action will add it as the body of the markdown.

read-action's People

Contributors

johnke avatar

Watchers

 avatar 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.