name: Update Trackers Data on: workflow_dispatch: # Allow manual triggering schedule: - cron: "0 0 * * 0" # Schedule to run every Sunday at midnight UTC (optional) jobs: exodus_data: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Download JSON file run: | wget -O trackers.json https://reports.exodus-privacy.eu.org/api/trackers - name: Parse JSON and create Android resource file run: | python - <\n\n' output += '\n' output += '\n\n' output += f'\n\n' output += f'\n\n' output += '\t\n' output += '\n'.join([f'\t\t{signature} ' for signature in signatures]) output += '\n\t\n' output += f'\n\n\n' output += '\t\n' output += '\n'.join([f'\t\t{website} ' for website in websites]) output += '\n\t\n' output += f'\n\n\n' output += '\t\n' output += '\n'.join([f'\t\t{name} ' for name in names]) output += '\n\t\n\n' output += '' # Write the output to the xml file with open(output_file, 'w') as file: file.write(output) EOF - name: Move Android resource file run: | if [ ! -d "./app/src/main/res/values/" ]; then mkdir -p ./app/src/main/res/values/ fi if [ -f "trackers.xml" ]; then echo "File exists, moving..." fi mv trackers.xml ./app/src/main/res/values/ if [ -f "./app/src/main/res/values/trackers.xml" ]; then echo "File moved successfully." fi - name: Cleanup run: | rm -f trackers.json # Check for changes - name: Check for changes id: git-status run: | export GIT_STATUS=$(git status --porcelain) echo "GIT_STATUS=$GIT_STATUS" >> $GITHUB_ENV if [ -z "$GIT_STATUS" ]; then echo "No changes detected..." fi # Commit changes to the repo - name: Commit changes if: env.GIT_STATUS != '' run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" git add . git commit -m "Automated Exodus data update" git push origin master