Book (977818008122) #407
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Add Book | |
run-name: Book (${{ inputs.isbn }}) | |
# Grant the action permission to write to the repository | |
permissions: | |
contents: write | |
# Trigger the action | |
on: | |
workflow_dispatch: | |
inputs: | |
isbn: | |
description: The book's ISBN. Required. | |
required: true | |
type: string | |
notes: | |
description: Notes about the book. Optional. | |
type: string | |
# If you do not submit date-started or date-finished, the book status will be set to "want to read" | |
date-started: | |
description: Date you started the book (YYYY-MM-DD). Optional. | |
type: string | |
date-finished: | |
description: Date you finished the book (YYYY-MM-DD). Optional. | |
type: string | |
# Set up the steps to run the action | |
jobs: | |
update-library: | |
runs-on: macOS-latest | |
name: Read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Read | |
uses: katydecorah/[email protected] | |
with: | |
thumbnail-width: 1280 | |
- name: Download the book thumbnail | |
if: env.BookThumbOutput != '' | |
run: curl "${{ env.BookThumb }}" -o "img/${{ env.BookThumbOutput }}" | |
- name: Commit updated read file | |
run: | | |
git pull | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add -A && git commit -m "📚 “${{ env.BookTitle }}” (${{ env.BookStatus }})" | |
git push | |