mirror of
https://github.com/Hamza417/Inure.git
synced 2025-05-17 19:15:56 +08:00
Added EtiP fetch workflow #385
This commit is contained in:
72
.github/workflows/exodus_etip_json_data.yml
vendored
Normal file
72
.github/workflows/exodus_etip_json_data.yml
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
name: Update ETIP Trackers JSON
|
||||
|
||||
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 etip_trackers.json https://etip.exodus-privacy.eu.org/api/trackers/
|
||||
|
||||
- name: Parse JSON and create Android resource file
|
||||
run: |
|
||||
python - <<EOF
|
||||
import json
|
||||
|
||||
json_file = 'etip_trackers.json'
|
||||
|
||||
# Format the JSON file
|
||||
with open(json_file, "r+", encoding="utf8") as file:
|
||||
json_content = json.load(file)
|
||||
json_content = json.dumps(json_content, indent=4, sort_keys=True)
|
||||
file.seek(0)
|
||||
file.write(json_content)
|
||||
|
||||
EOF
|
||||
|
||||
## Move etip_trackers.json to app/src/main/resources
|
||||
- name: Move Tracker JSON to Resources
|
||||
run: |
|
||||
if [ ! -d "./app/src/main/resources/" ]; then
|
||||
mkdir -p ./app/src/main/resources/
|
||||
fi
|
||||
|
||||
if [ -f "etip_trackers.json" ]; then
|
||||
echo "File exists, moving..."
|
||||
fi
|
||||
|
||||
mv etip_trackers.json ./app/src/main/resources/
|
||||
|
||||
if [ -f "./app/src/main/resources/etip_trackers.json" ]; then
|
||||
echo "File moved successfully."
|
||||
fi
|
||||
|
||||
# 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 ETIP JSON data update"
|
||||
git push origin master
|
1
.idea/dictionaries/Hamza.xml
generated
1
.idea/dictionaries/Hamza.xml
generated
@ -137,6 +137,7 @@
|
||||
<w>ertuğrul</w>
|
||||
<w>esac</w>
|
||||
<w>español</w>
|
||||
<w>etip</w>
|
||||
<w>euicc</w>
|
||||
<w>excidle</w>
|
||||
<w>extern</w>
|
||||
|
Reference in New Issue
Block a user