Skip to content

Commit

Permalink
Simplify nowReading output object (#145)
Browse files Browse the repository at this point in the history
* Simplify nowReading output object

* Update read-advanced.yml

* Update documentation

* 📚 “A Court of Thorns and Roses” (started)

---------

Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
katydecorah and actions-user authored Dec 15, 2023
1 parent a4c4fa3 commit 7313a17
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 16 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/read-advanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
uses: actions/checkout@v4

- name: Read
id: read_action
uses: ./

- name: Download the book thumbnail
Expand Down Expand Up @@ -86,3 +87,8 @@ jobs:
gh pr create -B main -H "review-book-${{env.BookIsbn}}" --fill
env:
GH_TOKEN: ${{ github.token }}

- name: Now reading
if: steps.read_action.outputs.nowReading != ''
run: |
echo "Now reading: ${{ steps.read_action.outputs.nowReading }}"
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ jobs:
uses: actions/checkout@v4

- name: Read
id: read_action
uses: katydecorah/[email protected]

- name: Download the book thumbnail
Expand Down Expand Up @@ -182,6 +183,11 @@ jobs:
gh pr create -B main -H "review-book-${{env.BookIsbn}}" --fill
env:
GH_TOKEN: ${{ github.token }}

- name: Now reading
if: steps.read_action.outputs.nowReading != ''
run: |
echo "Now reading: ${{ steps.read_action.outputs.nowReading }}"
```
</details>
Expand Down
20 changes: 20 additions & 0 deletions _data/read.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,5 +297,25 @@
"thumbnail": "https://books.google.com/books/content?id=rT7REAAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api",
"language": "en",
"link": "https://books.google.com/books/about/Unmasking_AI.html?hl=&id=rT7REAAAQBAJ"
},
{
"isbn": "9781619634459",
"dateStarted": "2023-12-15",
"status": "started",
"rating": "unrated",
"title": "A Court of Thorns and Roses",
"authors": [
"Sarah J. Maas"
],
"publishedDate": "2015-05-05",
"description": "The sexy, action-packed first book in the #1 New York Times bestselling Court of Thorns and Roses series from Sarah J. Maas. When nineteen-year-old huntress Feyre kills a wolf in the woods, a terrifying creature arrives to demand retribution. Dragged to a treacherous magical land she knows about only from legends, Feyre discovers that her captor is not truly a beast, but one of the lethal, immortal faeries who once ruled her world. At least, he's not a beast all the time. As she adapts to her new home, her feelings for the faerie, Tamlin, transform from icy hostility into a fiery passion that burns through every lie she's been told about the beautiful, dangerous world of the Fae. But something is not right in the faerie lands. An ancient, wicked shadow is growing, and Feyre must find a way to stop it, or doom Tamlin-and his world-forever. From bestselling author Sarah J. Maas comes a seductive, breathtaking book that blends romance, adventure, and faerie lore into an unforgettable read.",
"pageCount": 451,
"printType": "BOOK",
"categories": [
"Fiction"
],
"thumbnail": "https://books.google.com/books/content?id=E-kdBQAAQBAJ&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api",
"language": "en",
"link": "https://play.google.com/store/books/details?id=E-kdBQAAQBAJ"
}
]
Binary file added img/book-9781619634459.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 0 additions & 15 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,8 @@ describe("index", () => {
[
"nowReading",
{
"authors": [
"Raven Leilani",
],
"categories": [
"Fiction",
],
"dateAdded": undefined,
"dateFinished": undefined,
"dateStarted": "2022-01-02",
"description": "NEW YORK TIMES BESTSELLER Winner of the 2020 Center for Fiction First Novel Prize Winner of the 2020 National Book Critics Circle's John Leonard Prize for Best First Book Winner of the 2020 Kirkus Prize for Fiction Winner of the 2021 Dylan Thomas Prize Finalist for the 2021 PEN/Hemingway Award for Best First Novel Longlisted for the 2021 Andrew Carnegie Medal for Excellence in Fiction Longlisted for the 2021 PEN/Jean Stein Book Award Longlisted for the 2021 Women's Prize for Fiction A New York Times Notable Book of the Year Named Best Book of the Year by O: the Oprah Magazine, Vanity Fair, Los Angeles Times, Town and Country, Amazon, Indigo, NPR, Harper’s Bazaar, Kirkus Reviews, Marie Claire, Good Housekeeping Sharp, comic, disruptive, and tender, Luster sees a young Black woman fall into art and someone else's open marriage. Edie is stumbling her way through her twenties—sharing a subpar apartment in Bushwick, clocking in and out of her admin job, making a series of inappropriate sexual choices. She's also, secretly, haltingly, figuring her way into life as an artist. And then she meets Eric, a digital archivist with a family in New Jersey, including an autopsist wife who has agreed to an open marriage—with rules. As if navigating the constantly shifting landscapes of contemporary sexual manners and racial politics weren't hard enough, Edie finds herself unemployed and falling into Eric's family life, his home. She becomes a hesitant friend to his wife and a de facto role model to his adopted daughter. Edie is the only Black woman who young Akila knows. Razor-sharp, darkly comic, sexually charged, socially disruptive, Luster is a portrait of a young woman trying to make sense of her life in a tumultuous era. It is also a haunting, aching description of how hard it is to believe in your own talent and the unexpected influences that bring us into ourselves along the way.",
"isbn": "9780385696005",
"language": "en",
"link": "https://books.google.com/books/about/Luster.html?hl=&id=NFeTEAAAQBAJ",
"pageCount": 0,
"printType": "BOOK",
"publishedDate": "2020-08-04",
"status": "started",
"thumbnail": "https://books.google.com/books/content?id=NFeTEAAAQBAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api",
"title": "Luster",
},
Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ export async function read() {
exportVariable(`BookTitle`, newBook.title);

if (bookStatus === "started") {
setOutput("nowReading", newBook);
setOutput("nowReading", {
title: newBook.title,
description: newBook.description,
isbn: newBook.isbn,
thumbnail: newBook.thumbnail,
});
}

if (newBook.thumbnail) {
Expand Down

0 comments on commit 7313a17

Please sign in to comment.