Skip to content

Update IR Database #805

Update IR Database

Update IR Database #805

name: Update IR Database
on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
jobs:
update-database:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Current Repository
uses: actions/checkout@v3
with:
path: current-repo
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Flipper-IRDB
uses: actions/checkout@v3
with:
repository: Lucaslhm/Flipper-IRDB
path: Flipper-IRDB
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Run Parser Script
run: |
cd current-repo
python "Flipper-IRDB Parser Script.py"
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd current-repo
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add flipper_irdb_database.json
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update IR database [$(date +'%Y-%m-%d %H:%M:%S')]"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
git push
fi