Skip to content

Generate OFAC sanctioned digital currency addresses lists each night at 0 UTC #1396

Generate OFAC sanctioned digital currency addresses lists each night at 0 UTC

Generate OFAC sanctioned digital currency addresses lists each night at 0 UTC #1396

# This workflow will generate and update the lists in the 'lists' branch each night at 0 UTC
name: Generate OFAC sanctioned digital currency addresses lists each night at 0 UTC
on:
schedule:
- cron: '24 1 * * *'
workflow_dispatch:
jobs:
generate-lists:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Download the sdn_advanced.xml file
run: |
wget https://sanctionslistservice.ofac.treas.gov/api/PublicationPreview/exports/SDN_ADVANCED.ZIP
unzip SDN_ADVANCED.ZIP
ls -l
- name: Generate TXT and JSON files for all assets
run: |
mkdir data
python3 generate-address-list.py XBT ETH XMR LTC ZEC DASH BTG ETC BSV BCH XVG USDC USDT XRP TRX ARB BSC -f JSON TXT -path ./data -sdn SDN_ADVANCED.XML
- name: Commit files
run: |
git config --local user.email "45324+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git checkout lists
mv data/* .
git add sanctioned_addresses_* -f
git commit -m "Automatically updated lists: $(date)" -a || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: lists