From fbc55dab26208aa2789ed7de572c26744844410b Mon Sep 17 00:00:00 2001 From: bpmcdevitt Date: Thu, 17 Apr 2025 09:59:18 -0500 Subject: [PATCH] fix syntax --- .forgejo/workflows/daily-update.yml | 96 ++++++++++++++--------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/.forgejo/workflows/daily-update.yml b/.forgejo/workflows/daily-update.yml index 36b874a..b1b0660 100644 --- a/.forgejo/workflows/daily-update.yml +++ b/.forgejo/workflows/daily-update.yml @@ -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