added 2024_10_28 files #113
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: 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 |