Skip to content

Test URL Script

Test URL Script #4

Workflow file for this run

name: Test URL Script
on:
workflow_dispatch: # Manual trigger only
push:
branches:
- main
paths:
- 'sites-workflow/1getSitesURL.py'
jobs:
test-script:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Check current IP
run: |
echo "GitHub Actions IP: $(curl -s https://api.ipify.org)"
echo "Timestamp: $(date)"
- name: Run URL extraction script
run: |
cd sites-workflow
python 1getSitesURL.py
- name: Check if CSV was created
run: |
cd sites-workflow
if [ -f "site_urls.csv" ]; then
echo "✅ CSV file created successfully!"
echo "File size: $(wc -c < site_urls.csv) bytes"
echo "Number of lines: $(wc -l < site_urls.csv)"
echo ""
echo "First 10 lines of the file:"
head -10 site_urls.csv
else
echo "❌ CSV file was not created"
exit 1
fi
- name: Upload CSV as artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: extracted-urls-${{ github.run_number }}
path: sites-workflow/site_urls.csv
retention-days: 7
- name: Upload logs
uses: actions/upload-artifact@v4
if: always()
with:
name: script-logs-${{ github.run_number }}
path: sites-workflow/*.log
retention-days: 3