Update Android Data #219
This file contains hidden or 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: Update Android Data | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 */6 * * *' # Runs every 6 hours | |
jobs: | |
download_and_gzip: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Download JSON data file | |
id: download | |
run: | | |
wget -O android-data.json "https://sql.telemetry.mozilla.org/api/queries/103542/results.json?api_key=83yUK1sJn1LFwNuiL41aZLoPV5Wwh1tmtIhzEAkG" | |
continue-on-error: true | |
- name: Check if download succeeded | |
run: | | |
if [ ! -f android-data.json ]; then | |
echo "Download failed. Aborting to avoid overwriting previous data." | |
exit 1 | |
fi | |
- name: Gzip | |
run: | | |
gzip -c android-data.json > android-data.json.gz | |
rm android-data.json | |
- name: Commit and push gzipped file if changed | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add android-data.json.gz | |
git diff --cached --quiet || git commit -m "Update android-data.json.gz" | |
git push |