Skip to content

Commit

Permalink
Rename isbn input to identifier (#166)
Browse files Browse the repository at this point in the history
* Rename `isbn` input to `identifier`

* Update documentation

---------

Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
katydecorah and actions-user authored May 25, 2024
1 parent 192a8d8 commit 4facb03
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/read-advanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
date:
description: Date to record the status of the book (YYYY-MM-DD). Leave blank for today. Optional.
type: string
isbn:
identifier:
description: The book's ISBN. Required.
required: true
type: string
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/read-thumbnail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
on:
workflow_dispatch:
inputs:
isbn:
identifier:
description: The book's ISBN. Required.
required: true
type: string
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/read.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
on:
workflow_dispatch:
inputs:
isbn:
identifier:
description: The book's ISBN. Required.
required: true
type: string
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ permissions:
on:
workflow_dispatch:
inputs:
isbn:
identifier:
description: The book's ISBN. Required.
required: true
type: string
Expand Down Expand Up @@ -119,7 +119,7 @@ on:
date:
description: Date to record the status of the book (YYYY-MM-DD). Leave blank for today. Optional.
type: string
isbn:
identifier:
description: The book's ISBN. Required.
required: true
type: string
Expand Down Expand Up @@ -215,7 +215,7 @@ permissions:
on:
workflow_dispatch:
inputs:
isbn:
identifier:
description: The book's ISBN. Required.
required: true
type: string
Expand Down Expand Up @@ -306,7 +306,7 @@ To trigger the action, [create a workflow dispatch event](https://docs.github.co
{
"ref": "main", // Required. The git reference for the workflow, a branch or tag name.
"inputs": {
"isbn": "", // Required. The book's ISBN. Required.
"identifier": "", // Required. The book's ISBN. Required.
"book-status": "", // Required. What is the status of the book? Required. Default: `want to read`.
"date": "", // Date to record the status of the book (YYYY-MM-DD). Leave blank for today. Optional.
"notes": "", // Notes about the book. Optional.
Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/checkout-book.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("checkOutBook", () => {
checkOutBook(
{
fileName: "my-library.yml",
bookIsbn: "9780525620792",
inputIdentifier: "9780525620792",
dates: {
dateAdded: undefined,
dateStarted: undefined,
Expand All @@ -50,7 +50,7 @@ describe("checkOutBook", () => {
checkOutBook(
{
fileName: "my-library.yml",
bookIsbn: "9780525620792",
inputIdentifier: "9780525620792",
dates: {
dateAdded: undefined,
dateStarted: undefined,
Expand All @@ -70,7 +70,7 @@ describe("checkOutBook", () => {
checkOutBook(
{
fileName: "my-library.yml",
bookIsbn: "9780525620792",
inputIdentifier: "9780525620792",
tags: [""],
dates: {
dateAdded: undefined,
Expand All @@ -91,7 +91,7 @@ describe("checkOutBook", () => {
checkOutBook(
{
fileName: "my-library.yml",
bookIsbn: "12345",
inputIdentifier: "12345",
dates: {
dateAdded: undefined,
dateStarted: undefined,
Expand All @@ -110,7 +110,7 @@ describe("checkOutBook", () => {
checkOutBook(
{
fileName: "my-library.yml",
bookIsbn: "12345",
inputIdentifier: "12345",
dates: {
dateAdded: undefined,
dateStarted: undefined,
Expand Down
30 changes: 15 additions & 15 deletions src/__tests__/clean-book.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("cleanBook", () => {
{
dateType: { dateFinished: dateFinished },
notes: "I loved it!",
bookIsbn: "0525658181",
inputIdentifier: "0525658181",
providers: [],
bookStatus: "finished",
filename: "_data/read.yml",
Expand Down Expand Up @@ -67,7 +67,7 @@ describe("cleanBook", () => {
{
dateType: { dateFinished: dateFinished },
notes: "I loved it!",
bookIsbn: "0525658181",
inputIdentifier: "0525658181",
providers: [],
bookStatus: "finished",
rating: "⭐️⭐️⭐️⭐️⭐️",
Expand Down Expand Up @@ -109,7 +109,7 @@ describe("cleanBook", () => {
cleanBook(
{
notes: "I loved it!",
bookIsbn: "0525658181",
inputIdentifier: "0525658181",
providers: [],
bookStatus: "finished",
filename: "_data/read.yml",
Expand Down Expand Up @@ -149,7 +149,7 @@ describe("cleanBook", () => {
cleanBook(
{
dateType: { dateStarted: "2022-01-01" },
bookIsbn: "1234597890",
inputIdentifier: "1234597890",
providers: [],
bookStatus: "started",
filename: "_data/read.yml",
Expand Down Expand Up @@ -182,7 +182,7 @@ describe("cleanBook", () => {
"authors, description",
],
[
"BookIsbn",
"BookIdentifier",
"1234597890",
],
]
Expand All @@ -195,7 +195,7 @@ describe("cleanBook", () => {
cleanBook(
{
dateType: { dateStarted: "2022-01-01" },
bookIsbn: "1234597890",
inputIdentifier: "1234597890",
providers: [],
bookStatus: "started",
filename: "_data/read.yml",
Expand Down Expand Up @@ -229,7 +229,7 @@ describe("cleanBook", () => {
"title",
],
[
"BookIsbn",
"BookIdentifier",
"1234597890",
],
]
Expand All @@ -242,7 +242,7 @@ describe("cleanBook", () => {
cleanBook(
{
dateType: { dateStarted: "2022-01-01" },
bookIsbn: "1234597890",
inputIdentifier: "1234597890",
providers: [],
bookStatus: "started",
filename: "_data/read.yml",
Expand Down Expand Up @@ -276,7 +276,7 @@ describe("cleanBook", () => {
"description",
],
[
"BookIsbn",
"BookIdentifier",
"1234597890",
],
]
Expand All @@ -289,7 +289,7 @@ describe("cleanBook", () => {
cleanBook(
{
dateType: { dateStarted: "2022-01-01" },
bookIsbn: "1234597890",
inputIdentifier: "1234597890",
providers: [],
bookStatus: "started",
filename: "_data/read.yml",
Expand Down Expand Up @@ -321,7 +321,7 @@ describe("cleanBook", () => {
"title, pageCount, authors, description",
],
[
"BookIsbn",
"BookIdentifier",
"1234597890",
],
]
Expand All @@ -339,7 +339,7 @@ describe("cleanBook", () => {
cleanBook(
{
dateType: { dateStarted: "2022-01-01" },
bookIsbn: "1234597890",
inputIdentifier: "1234597890",
providers: [],
bookStatus: "started",
filename: "_data/read.yml",
Expand All @@ -365,7 +365,7 @@ describe("cleanBook", () => {
{
dateType: { dateFinished: dateFinished },
notes: "I loved it!",
bookIsbn: "0525658181",
inputIdentifier: "0525658181",
providers: [],
bookStatus: "finished",
filename: "_data/read.yml",
Expand Down Expand Up @@ -409,7 +409,7 @@ describe("cleanBook", () => {
{
dateType: { dateFinished: dateFinished },
notes: "I loved it!",
bookIsbn: "0525658181",
inputIdentifier: "0525658181",
providers: [],
bookStatus: "finished",
filename: "_data/read.yml",
Expand Down Expand Up @@ -453,7 +453,7 @@ describe("cleanBook", () => {
{
dateType: { dateFinished },
notes: "I loved it!",
bookIsbn: "0525658181",
inputIdentifier: "0525658181",
providers: [],
bookStatus: "finished",
filename: "_data/read.yml",
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/get-book.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("getBook", () => {
dateType: {
dateFinished,
},
bookIsbn: "9780525658184",
inputIdentifier: "9780525658184",
providers: ["google"],
bookStatus: "finished",
filename: "_data/read.yml",
Expand Down Expand Up @@ -74,7 +74,7 @@ describe("getBook", () => {
dateStarted: undefined,
dateFinished,
},
bookIsbn: "9780525658184",
inputIdentifier: "9780525658184",
providers: ["google"],
bookStatus: "finished",
filename: "_data/read.json",
Expand Down
32 changes: 18 additions & 14 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe("index", () => {
value: {
payload: {
inputs: {
isbn: "9780385696005",
identifier: "9780385696005",
"book-status": "started",
date: "2022-01-02",
},
Expand All @@ -88,7 +88,7 @@ describe("index", () => {
"pageCount",
],
[
"BookIsbn",
"BookIdentifier",
"9780385696005",
],
[
Expand Down Expand Up @@ -177,7 +177,7 @@ describe("index", () => {
value: {
payload: {
inputs: {
isbn: "9780525620792",
identifier: "9780525620792",
"book-status": "finished",
date: "2021-09-30",
},
Expand Down Expand Up @@ -235,7 +235,7 @@ describe("index", () => {
value: {
payload: {
inputs: {
isbn: "9780525511342",
identifier: "9780525511342",
"book-status": "finished",
date: "2022-08-02",
},
Expand Down Expand Up @@ -323,7 +323,7 @@ describe("index", () => {
value: {
payload: {
inputs: {
isbn: "9780385696005",
identifier: "9780385696005",
"book-status": "want to read",
},
},
Expand All @@ -345,7 +345,7 @@ describe("index", () => {
"pageCount",
],
[
"BookIsbn",
"BookIdentifier",
"9780385696005",
],
[
Expand Down Expand Up @@ -422,10 +422,12 @@ describe("index", () => {
});

await read();
expect(setFailedSpy).toHaveBeenCalledWith("Missing `isbn` in payload");
expect(setFailedSpy).toHaveBeenCalledWith(
"Missing `identifier` in payload"
);
});

test("error, missing isbn", async () => {
test("error, missing identifier", async () => {
const setFailedSpy = jest.spyOn(core, "setFailed");
Object.defineProperty(github, "context", {
value: {
Expand All @@ -438,7 +440,9 @@ describe("index", () => {
},
});
await read();
expect(setFailedSpy).toHaveBeenCalledWith("Missing `isbn` in payload");
expect(setFailedSpy).toHaveBeenCalledWith(
"Missing `identifier` in payload"
);
});

test("error, setFailed", async () => {
Expand All @@ -447,7 +451,7 @@ describe("index", () => {
value: {
payload: {
inputs: {
isbn: "9780385696005",
identifier: "9780385696005",
"book-status": "want to read",
},
},
Expand All @@ -467,7 +471,7 @@ describe("index", () => {
value: {
payload: {
inputs: {
isbn: "9780385696005",
identifier: "9780385696005",
tags: "new, recommend",
"book-status": "want to read",
},
Expand Down Expand Up @@ -535,7 +539,7 @@ describe("index", () => {
value: {
payload: {
inputs: {
isbn: "9780385696005",
identifier: "9780385696005",
"book-status": "finished",
date: "2022-02-02",
},
Expand All @@ -552,7 +556,7 @@ describe("index", () => {
value: {
payload: {
inputs: {
isbn: "9780385696005",
identifier: "9780385696005",
"book-status": "finished",
date: "1234",
},
Expand All @@ -571,7 +575,7 @@ describe("index", () => {
value: {
payload: {
inputs: {
isbn: "9780385696005",
identifier: "9780385696005",
"book-status": "did not finish",
},
},
Expand Down
Loading

0 comments on commit 4facb03

Please sign in to comment.