on:
  push:
  workflow_dispatch:
  schedule:
    - cron:  '30 * * * *' # every hour, at ~:30 https://crontab.guru/#30_*_*_*_*

jobs:
  update-news-releases:
    runs-on: ubuntu-latest
    steps:
    - name: Check out this repo
      uses: actions/checkout@v2
    - name: Set up Node
      uses: actions/setup-node@v2
      with:
        node-version: 16
    - name: Pull Node packages
      run: |-
        npm install
    - name: Fetch latest data
      run: |-
        node _scripts/generate-link-posts.mjs
    - name: Commit and push if there are new links
      run: |-
          git config user.name "Automated"
          git config user.email "actions@users.noreply.github.com"
          git add links/
          timestamp=$(date -u)
          git commit -m "Latest links from Pinboard: ${timestamp}" || exit 0
          git push
Add GitHub Action to automatically post links
Add GitHub Action to automatically post links
