Skip to content

Scrape (OCaml Planet) #1696

Scrape (OCaml Planet)

Scrape (OCaml Planet) #1696

Workflow file for this run

name: Scrape (OCaml Planet)
on:
workflow_dispatch:
schedule:
# Run every day
- cron: 36 5 * * *
jobs:
scrape:
name: Run Scrapers
if: github.event_name != 'schedule' || github.repository == 'ocaml/ocaml.org'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Install runtime dependencies
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libev4 libonig5
- name: Download scraper binary
run: |
gh release download scraper-latest --pattern scrape.exe
chmod +x scrape.exe
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run scrapers
run: |
make scrape_ocaml_planet \
SCRAPE=./scrape.exe \
COMMIT_FILE=_scrape_commit.md \
REPORT_FILE=_scrape_report.md
- name: Read commit message
id: scrape
run: |
{ echo "msg<<EOF"; cat _scrape_commit.md; echo "EOF"; } >> "$GITHUB_OUTPUT"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
with:
title: '[scrape] New OCaml Planet posts'
commit-message: ${{ steps.scrape.outputs.msg }}
body-path: _scrape_report.md
labels: scrape
branch: create-pull-request/patch-scrape-planet
add-paths: |
data/video-watch.yml
data/video-youtube.yml
data/planet/*/*.md