TermuxHub Metadata Synchronization #46
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: TermuxHub Metadata Synchronization | |
| on: | |
| push: | |
| paths: | |
| - metadata/metadata.json | |
| schedule: | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Run metadata synchronization | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: node .github/scripts/sync-metadata.js | |
| - name: Commit and push changes | |
| run: | | |
| git config user.name "termuxhub-bot" | |
| git config user.email "bot@termuxhub.dev" | |
| if [ -n "$(git status --porcelain)" ]; then | |
| git add ./metadata | |
| git commit -m "metadata: synchronize tool metadata" | |
| git push | |
| else | |
| echo "No changes detected" | |
| fi |