name: Backup Dismissed Tasks on: schedule: - cron: '0 */6 * * *' # Every 6 hours workflow_dispatch: {} concurrency: group: repo-file-writes cancel-in-progress: false jobs: backup: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Fetch dismissed task IDs from OrgMyLife run: | # Get all dismissed and completed tasks (their source_ids) RESPONSE=$(curl -s -u "${{ secrets.ORGMYLIFE_USER }}:${{ secrets.ORGMYLIFE_PASS }}" \ -H "Authorization: Bearer ${{ secrets.ORGMYLIFE_API_SECRET }}" \ "https://api.andreknie.de/api/tasks/dismissed") echo "$RESPONSE" > dismissed_tasks.json cat dismissed_tasks.json | head -c 200 - name: Commit if changed run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add dismissed_tasks.json git diff --cached --quiet && echo "No changes" && exit 0 git commit -m "chore: backup dismissed task IDs [skip ci]" git pull --rebase origin main || true git push