name: Agents run-name: >- AI bot at #${{ gitea.event.issue.number || gitea.event.pull_request.number }} on: issues: types: [opened] pull_request: types: [opened, review_requested] issue_comment: types: [created] pull_request_review_comment: types: [created] # New human events replace stale runs for the same work item. AI-bot comments # get unique groups so their skipped workflows cannot cancel an active login. concurrency: group: >- agents-${{ gitea.event.sender.login == 'bot' && gitea.run_id || gitea.event.issue.number || gitea.event.pull_request.number }} cancel-in-progress: true jobs: bot: # Nothing the bot account posts can start a run, so it cannot trigger itself. if: > gitea.event.sender.login != 'bot' && ((gitea.event_name == 'issues' && contains(gitea.event.issue.body, '@bot')) || (gitea.event_name == 'pull_request' && ((gitea.event.action == 'opened' && contains(gitea.event.pull_request.body, '@bot')) || gitea.event.requested_reviewer.login == 'bot')) || (gitea.event_name == 'issue_comment' && contains(gitea.event.comment.body, '@bot')) || (gitea.event_name == 'pull_request_review_comment' && contains(gitea.event.review.content, '@bot'))) runs-on: self-hosted container: volumes: - bot-home:/root steps: - name: Run AI bot # Intentionally follow protected main so centrally managed profiles and # quota fallbacks update without per-repository credential changes. uses: https://git.capsulizers.com/commons/bot-agents@main with: master-key: ${{ secrets.BOT_AGENTS_MASTER_KEY }}