name: giteabot on: # pull_request_target gives this workflow access to GITEABOT_TOKEN on PRs from # forks, which the bot needs to write labels, statuses and comments. Safe here # because the job only runs a pinned action and never checks out PR HEAD. # These PR lifecycle events drive label maintenance, lgtm, and explicit bot # actions triggered by relevant label changes. pull_request_target: # zizmor: ignore[dangerous-triggers] types: - opened - synchronize - labeled - unlabeled - closed - review_requested - review_request_removed # Reviews arrive through giteabot-review because fork PR review runs get no secrets workflow_run: workflows: - giteabot-review types: - requested # Daily housekeeping like locks, stale feedback issues, last calls and milestones schedule: - cron: "15 3 * * *" # Allow maintainers to rerun selected checks manually when debugging bot # behavior without waiting for another repository event. workflow_dispatch: inputs: checks: description: Comma-separated list of non-backport checks to run required: false default: backport_branches,labels,lock,feedback,last_call,milestones,lgtm,translation_comment,pr_actions permissions: {} concurrency: group: ${{ format('{0}-{1}', github.workflow, github.event_name == 'pull_request_target' && format('pr-{0}', github.event.pull_request.number) || github.event_name == 'workflow_run' && format('review-{0}', github.event.workflow_run.head_sha) || 'maintenance') }} cancel-in-progress: false jobs: giteabot: if: github.repository == 'go-gitea/gitea' && (github.event_name != 'workflow_run' || github.event.workflow_run.event == 'pull_request_review') runs-on: ubuntu-latest timeout-minutes: 30 permissions: contents: read issues: write pull-requests: write statuses: write steps: - uses: go-gitea/giteabot@b830f7aa810e43afc1b2f8e8968a30754e6ff5d3 # v1.4.1 with: github_token: ${{ secrets.GITEABOT_TOKEN }} checks: ${{ github.event.inputs.checks || 'backport_branches,labels,lock,feedback,last_call,milestones,lgtm,translation_comment,pr_actions' }}