Sync Meshtastic nodes from online sources #10
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: Sync Meshtastic nodes from online sources | |
| on: | |
| schedule: | |
| # Runs every hour at minute 0 | |
| - cron: "0 * * * *" | |
| workflow_dispatch: ~ # Allows manual triggering | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| sync-meshtastic-data: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GH_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r meshtastic/nodes/requirements.txt | |
| - name: Run Python script to update Meshtastic nodes data | |
| run: python meshtastic/nodes/sync_nodes.py | |
| --nodes-data-file meshtastic/nodes/nodes.json | |
| - name: Commit data files if modified | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| add: 'meshtastic' | |
| default_author: github_actions | |
| message: "Meshtastic data updated [skip actions]" # https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci/ | |
| push: '--force' |