Skip to content

Pull and Archive Active Police Dispatch Calls #74692

Pull and Archive Active Police Dispatch Calls

Pull and Archive Active Police Dispatch Calls #74692

name: Pull and Archive Active Police Dispatch Calls
on:
workflow_dispatch: {}
schedule:
- cron: '*/10 * * * *'
jobs:
Pull-Active-Police-Dispatch-Calls:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
cache: 'pip'
- name: Install dependencies
run: |
pip install -r requirements.txt
working-directory: active-police-dispatch-calls
- name: Get current date
run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
- name: Run script
run: |
python scrape.py
working-directory: active-police-dispatch-calls
- name: Commit to repo
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "there are changes to commit";
else
exit 0;
fi
git config --local user.email "github-actions@github.com"
git config --local user.name "GitHub Actions"
git add .
git commit -m "Active Police Dispatch Calls: ${{ env.NOW }}"
git push
working-directory: active-police-dispatch-calls