-
Notifications
You must be signed in to change notification settings - Fork 9
61 lines (55 loc) · 1.63 KB
/
pdf_to_txt.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: PDF to text
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Manual trigger'
jobs:
printInputs:
runs-on: ubuntu-latest
steps:
- run: |
echo "Log level: ${{ github.event.inputs.logLevel }}"
echo "Tags: ${{ github.event.inputs.tags }}"
job_id:
name: PDF to text
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run script
env:
# bash argument
START: ${{ secrets.START }}
END: ${{ secrets.END }}
# proxy
PROXY_USER: ${{ secrets.PROXY_USER }}
PROXY_PASSWORD: ${{ secrets.PROXY_PASSWORD }}
PROXY_HOST: ${{ secrets.PROXY_HOST }}
PROXY_PORT: ${{ secrets.PROXY_PORT }}
PROXY_SERVER: ${{ secrets.PROXY_SERVER }}
# git
ACCESS_TOKEN: ${{ secrets.TOKEN }}
BRANCH: ${{ secrets.BRANCH }}
EMAIL: ${{ secrets.EMAIL }}
USERNAME: ${{ secrets.USERNAME }}
run: |
# set up git
git config --global user.email ${EMAIL}
git config --global user.name ${USERNAME}
git remote set-url origin https://${USERNAME}:${ACCESS_TOKEN}@github.com/${USERNAME}/nber.git
# download module for pdftotext
sudo apt-get install poppler-utils
# run bash script
bash pdf_to_txt.sh $START $END
- name: Commit changes
run: |
git add paper/*
git commit --allow-empty -m "Add paper(s)"
git pull --no-rebase origin ${BRANCH}
git push -u origin ${BRANCH}