Publish Pinboard annotations #14380
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: Publish Pinboard annotations | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 11-23,0-2 * * *' # waking hours EST (7 to 22), at ~:30 https://crontab.guru/#30_11-23,0-2_*_*_* | |
jobs: | |
crosspost-pinboard-links: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out this repo | |
uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- name: Pull Node packages | |
run: |- | |
npm ci | |
- name: Fetch latest data | |
run: |- | |
node _scripts/generate-link-posts.mjs | |
env: | |
PINBOARD_API_TOKEN: ${{ secrets.PINBOARD_API_TOKEN }} | |
- name: Commit and push if there are new links | |
run: |- | |
git config user.name "Automated" | |
git config user.email "[email protected]" | |
git add _links/*.md | |
timestamp=$(date -u) | |
git commit -m "Latest links from Pinboard: ${timestamp}" || exit 0 | |
git push |