-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (36 loc) · 1.08 KB
/
Copy pathextract-pdf-text.yaml
File metadata and controls
43 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Extract PDF text for search index
on:
push:
branches: [main]
paths:
- "corpus/**/*.pdf"
- "corpus/MANIFEST.yaml"
- "scripts/extract_pdf_text.py"
workflow_dispatch: {}
permissions:
contents: write
jobs:
extract:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install -r scripts/requirements.txt
- name: Extract text from corpus PDFs
run: python scripts/extract_pdf_text.py --repo-root .
- name: Commit updated extracted text
run: |
git config user.name "corpus-extraction-bot"
git config user.email "actions@users.noreply.github.com"
git add corpus/_extracted/
if git diff --cached --quiet; then
echo "No changes to commit."
else
git commit -m "Extract PDF text for search index ($(date -u +%Y-%m-%d))"
git push
fi