9781529146165 2024-08-01 #466
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 | |
on: | |
issues: | |
types: [labeled, edited] | |
env: | |
content: ${{ github.event.issue.body }} | |
label: ${{ github.event.label.name }} | |
issue_number: ${{ github.event.issue.number }} | |
actor: ${{ github.actor }} | |
owner: ${{ github.repository_owner }} | |
jobs: | |
Checks: | |
if: contains( github.event.issue.labels.*.name, 'read') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Echo | |
run: echo "Label is $label" | |
Build: | |
needs: Checks | |
if: ${{ github.actor == github.repository_owner }} | |
runs-on: macOS-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Read | |
uses: mat-0/[email protected] | |
- name: Download the book thumbnail | |
run: curl "${{env.BookThumb}}" -o "images/books/${{env.BookThumbOutput}}" | |
- name: Commit files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add -A && git commit -m "Added ${{ env.BookTitle }}" | |
git push | |
- name: Close issue | |
uses: peter-evans/close-issue@v3 | |
with: | |
issue-number: "${{ env.IssueNumber }}" | |
comment: "📚 You read ${{ env.BookTitle }} on ${{env.DateRead}}." | |