bookshelf #1509
This file contains hidden or 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: bookshelf | |
| on: | |
| schedule: | |
| - cron: "34 0/6 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| tags: | |
| description: "check yourself?" | |
| required: false | |
| type: boolean | |
| permissions: | |
| contents: write | |
| jobs: | |
| reading: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install deps | |
| run: npm ci --omit=dev | |
| - name: Check for reading updates | |
| run: npm run reading && npm run have-read | |
| env: | |
| NOTION_ACCESS_TOKEN: ${{ secrets.NOTION_ACCESS_TOKEN }} | |
| - name: Check for changes | |
| id: check_changes | |
| run: | | |
| if [[ -n $(git status --porcelain) ]]; then | |
| echo "changes=true" >> "$GITHUB_OUTPUT"; | |
| fi | |
| - name: Commit results | |
| if: steps.check_changes.outputs.changes == 'true' | |
| run: | | |
| git pull | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| git add -A && git commit -m "📖 updated book data" | |
| git push origin main |