Autonomous Agent — Self-Modifying Loop #375
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: Autonomous Agent — Self-Modifying Loop | |
| on: | |
| push: | |
| branches: [master, main] | |
| schedule: | |
| - cron: '0 */4 * * *' # every 4 hours | |
| workflow_dispatch: | |
| inputs: | |
| task: | |
| description: 'Override task prompt' | |
| required: false | |
| default: '' | |
| permissions: | |
| contents: write | |
| jobs: | |
| agent: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install deps | |
| run: pip install requests orjson | |
| - name: Run sovereign agent | |
| env: | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| OVERRIDE_TASK: ${{ github.event.inputs.task }} | |
| run: python .github/scripts/agent.py | |
| - name: Commit changes | |
| run: | | |
| git config user.name "SNAPKITTY-AGENT" | |
| git config user.email "agent@snapkittywest.io" | |
| git add -A | |
| if git diff --cached --quiet; then | |
| echo "Nothing to commit." | |
| else | |
| git commit -m "⟦Ω⟧ agent: $(date -u +%Y-%m-%dT%H:%M:%SZ)" | |
| git push origin HEAD | |
| fi |