-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (38 loc) · 1.15 KB
/
get_text.yml
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
name: Dump out PDF text
on:
push:
branches:
- 'master'
workflow_dispatch:
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
-
name: "Check out this repo"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libpoppler-cpp-dev libpoppler-dev poppler-utils rename
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
- name: Fix changed file names
run: |
cd input && rename -v 's/ \(.*\)\./\./' ./*.pdf
for f in *\ *; do mv "$f" "${f// /_}"; done
- name: Dump out text
run: |
cd input && for file in *.pdf; do pdftotext "$file" "$GITHUB_WORKSPACE/output/${file%.*}.txt"; done
-
name: "Commit and push if it changed"
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push