Process XML and Generate Results #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Process XML and Generate Results | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * *' # This line schedules the workflow to run every day at midnight | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Download XML | |
run: | | |
curl -O https://www.treasury.gov/ofac/downloads/sanctions/1.0/sdn_advanced.xml | |
- name: Create output directory | |
run: | | |
mkdir -p Sanctioned\ Addresses | |
- name: Run Python script | |
run: | | |
python process_xml.py ETH -f TXT -path ./Sanctioned\ Addresses | |
- name: Commit and push if it changed | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git diff --quiet && git diff --staged --quiet || (git commit -m "Update data"; git push) |