Sync Harmonica Sessions #149
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 Harmonica Sessions | |
| on: | |
| schedule: | |
| # Every 6 hours | |
| - cron: '0 */6 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Sync NSRT sessions | |
| env: | |
| HARMONICA_API_KEY: ${{ secrets.HARMONICA_API_KEY }} | |
| run: npx harmonica-sync | |
| - name: Commit new sessions | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add sessions/ | |
| if git diff --cached --quiet; then | |
| echo "No new sessions to commit" | |
| else | |
| git commit -m "Add new Harmonica session results | |
| Automated sync from app.harmonica.chat" | |
| git push | |
| fi |