name: "Run Docubot on @docubot mention" on: # These triggers are currently disabled because they cause workflow runs for ALL # comments in the org, even though the job only executes when @docubot is mentioned, # which is noisy. # issue_comment: # types: [created] # pull_request_review_comment: # types: [created] workflow_dispatch: inputs: pr_number: description: 'PR number to run Docubot on (leave empty to run on current branch)' required: false type: string prompt: description: Prompt to send to Docubot required: true default: "Analyze this PR for documentation needs" warp_channel: type: choice description: Warp release channel required: true default: dev options: - dev - preview - stable profile_id: description: Warp profile ID required: false permissions: contents: write issues: write pull-requests: write id-token: write actions: read jobs: run_docubot: if: > ( contains(github.event.comment.body, '@docubot') || inputs.prompt ) && github.actor != 'github-actions[bot]' runs-on: namespace-profile-ubuntu-20-04 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: # Check out the appropriate branch based on trigger type # TODO: do this in sdk? ref: > ${{ github.event_name == 'workflow_dispatch' && (inputs.pr_number != '' && format('refs/pull/{0}/head', inputs.pr_number) || github.ref) || ( github.event_name == 'pull_request_review_comment' && format('refs/pull/{0}/head', github.event.pull_request.number) || format('refs/pull/{0}/head', github.event.issue.number) ) }} - name: Call Docubot uses: ./.github/actions/docubot with: prompt: ${{ github.event.comment.body || inputs.prompt}} warp_api_key: ${{ secrets.WARP_DEV_API_KEY }} warp_channel: ${{ inputs.warp_channel || 'dev' }} profile_id: ${{ inputs.profile_id || vars.WARP_DEV_API_PROFILE_ID }} github_token: ${{ secrets.PEI_GH_TOKEN_PLS_DEL }}