fix syntax
This commit is contained in:
parent
94943274f1
commit
fbc55dab26
1 changed files with 48 additions and 48 deletions
|
@ -11,12 +11,12 @@ jobs:
|
|||
update-incidents:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: node:18
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
server-url: 'https://git.mcdevitt.tech'
|
||||
image: node:18
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
server-url: 'https://git.mcdevitt.tech'
|
||||
repository: 'bpmcdevitt/madison_police_incident_report_collector'
|
||||
|
||||
- name: Setup SSH
|
||||
|
@ -27,46 +27,46 @@ jobs:
|
|||
ssh-keyscan -p 3022 git.mcdevitt.tech >> ~/.ssh/known_hosts
|
||||
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install requests feedparser beautifulsoup4
|
||||
|
||||
- name: Run incident parser script
|
||||
run: |
|
||||
python madison_police_incidents.py
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config --local user.email "action@git.mcdevitt.tech"
|
||||
git config --local user.name "Git Action"
|
||||
|
||||
- name: Check for changes
|
||||
id: check_changes
|
||||
run: |
|
||||
if [[ -n $(git status --porcelain) ]]; then
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Commit and push if there are changes
|
||||
if: steps.check_changes.outputs.has_changes == 'true'
|
||||
run: |
|
||||
# Get current date for commit message
|
||||
CURRENT_DATE=$(date '+%Y-%m-%d')
|
||||
|
||||
# Add all changes
|
||||
git add incidents/
|
||||
|
||||
# Commit with date in message
|
||||
git commit -m "Update incident reports: $CURRENT_DATE"
|
||||
|
||||
# Push changes
|
||||
git push
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install requests feedparser beautifulsoup4
|
||||
|
||||
- name: Run incident parser script
|
||||
run: |
|
||||
python madison_police_incidents.py
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config --local user.email "action@git.mcdevitt.tech"
|
||||
git config --local user.name "Git Action"
|
||||
|
||||
- name: Check for changes
|
||||
id: check_changes
|
||||
run: |
|
||||
if [[ -n $(git status --porcelain) ]]; then
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Commit and push if there are changes
|
||||
if: steps.check_changes.outputs.has_changes == 'true'
|
||||
run: |
|
||||
# Get current date for commit message
|
||||
CURRENT_DATE=$(date '+%Y-%m-%d')
|
||||
|
||||
# Add all changes
|
||||
git add incidents/
|
||||
|
||||
# Commit with date in message
|
||||
git commit -m "Update incident reports: $CURRENT_DATE"
|
||||
|
||||
# Push changes
|
||||
git push
|
||||
|
|
Loading…
Add table
Reference in a new issue