Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zwacky/goodreads-profile-workflow
Show what you're currently reading and recently read on your GitHub profile readme.
https://github.com/zwacky/goodreads-profile-workflow
Last synced: 5 days ago
JSON representation
Show what you're currently reading and recently read on your GitHub profile readme.
- Host: GitHub
- URL: https://github.com/zwacky/goodreads-profile-workflow
- Owner: zwacky
- License: gpl-3.0
- Created: 2021-03-28T15:36:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T06:54:27.000Z (7 months ago)
- Last Synced: 2024-10-20T04:05:59.819Z (25 days ago)
- Language: JavaScript
- Size: 136 KB
- Stars: 45
- Watchers: 5
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Goodreads profile workflow
Automatically update your README with what you're currently reading—or any other Goodreads reading shelf of yours.
![goodreads-github-profile-update-v1](https://user-images.githubusercontent.com/1093032/112973602-d3662f80-9151-11eb-9a94-6c05eadba362.png)
### How to use
- Go to your repository
- Add the following section to your **README.md** file, you can give whatever title you want. Just make sure that you use `` in your readme. The workflow will replace this comment with the actual list of currently reading books:```markdown
### Books I'm currently reading```
- Create a folder named `.github` and create a `workflows` folder inside it if it doesn't exist.
- Create a new file named `goodreads-profile-workflow.yml` with the following contents inside the workflows folder:```yaml
name: Latest book list from a goodreads
on:
schedule: # Run workflow automatically
# This will make it run every hour
- cron: "0 * * * *"
# Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly
workflow_dispatch:
jobs:
update-readme-with-goodreads-books:
name: Update this repo's README with what you're currently reading
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: zwacky/goodreads-profile-workflow@main
with:
# Replace this with your goodreads user id
goodreads_user_id: "92930971"
shelf: "currently-reading"
```- Replace the above `goodreads_user_id` with yours. To find out your user ID go to "My Books" on Goodreads and you'll see it in the URL.
- Commit and wait for it to run automatically or you can also trigger it manually to see the result instantly. To trigger the workflow manually check out [this blog post](https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/) by GitHub.### Inputs
Here are all the inputs you can change in your goodreads-profile-workflow.yml file under `steps[*].with`:
| Option | Default Value | Description | Required |
|--------|--------|--------|--------|
| `goodreads_user_id` | "" | The Goodreads account ID to fetch the books from. | Yes |
| `shelf` | "`currently-reading`" | The Goodreads shelf/list the books are in (default shelves: currently-reading, read, to-read) | No |
| `max_books_count` | "`10`" | Max count of books that will be taken from the shelf/list | No |
| `readme_file_path` | "`./README.md`" | Path of the readme file you want to update | No |
| `output_only` | "`false`" | Usually used together with local-run.js. Sets the generated array as `books` [output variable](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs) so that it can be consumed in other actions | No |
| `comment_tag_name` | "`GOODREADS-LIST`" | Overrides the default comment tag name (``). In case you want to run multiple instances over the same README | No |
| `template` | "`- [$title]($url) by $author (⭐️$average_rating)`" | The list template written in Markdown.
**Suported variables:**
- `$title`: Book title
- `$url`: Goodreads URL of the book
- `$author`: Book author
- `$published_year`: Book's published year
- `$average_rating`: Book's rating on Goodreads
- `$my_rating`: User's rating of the book (from 1-5)
- `$my_rating_stars`: User's rating of the book in emoji star (from ⭐️ to ⭐️⭐️⭐️⭐️⭐️)
| `sort_by_fields` | ">pubDate" | sort the list by fields from the RSS response, preprended by ascending `'<'` or descending `'>'` order.
**Example:**
"`>user_rating,>average_rating`" sorts first by user_rating and within the same user_rating, it'll then sort by average_rating, both in descending order.
**Suported fields:**
- `pubDate`
- `title`
- `isbn`
- `user_rating`
- `user_read_at`
- `user_date_added`
- `user_date_created`
- `average_rating`
- `book_published`
- [see all fields in the example RSS response](https://github.com/zwacky/goodreads-profile-workflow/blob/main/test/read.xml)
### More resources
- Check out gautamkrishnar's [blog-post-workflow](https://github.com/gautamkrishnar/blog-post-workflow) for another great update readme workflow