Skip to content

Enhance bugbot trigger conditions in workflow #1

Enhance bugbot trigger conditions in workflow

Enhance bugbot trigger conditions in workflow #1

Workflow file for this run

name: Pull Request
on:
workflow_call:
inputs:
bugbot_enabled:
description: 'Enable BugBot review'
type: boolean
required: false
default: true
jobs:
trigger-bugbot:

Check failure on line 13 in .github/workflows/pull-request.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/pull-request.yml

Invalid workflow file

You have an error in your yaml syntax on line 13
runs-on: ubuntu-latest
if: ${{
inputs.bugbot_enabled &&
!github.event.pull_request.draft &&
github.event_name == 'pull_request' &&
contains(fromJson('["opened", "reopened", "synchronize"]'), github.event.action)
}}
steps:
- name: Validate PAT
env:
PAT: ${{ secrets.PERSONAL_ACCESS_TOKEN_ADRIAAN_ISSUES }}
run: |
if [[ "$PAT" != github_pat_* ]]; then
echo "::error::PERSONAL_ACCESS_TOKEN_ADRIAAN_ISSUES is not set or is not a valid fine-grained PAT (must start with github_pat_)"
exit 1
fi
- name: Comment to trigger BugBot
uses: actions/github-script@v7
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN_ADRIAAN_ISSUES }}
script: |
const comment = await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: '@cursor review'
})
await github.graphql(`
mutation MinimizeComment($id: ID!) {
minimizeComment(input: { subjectId: $id, classifier: OUTDATED }) {
minimizedComment { isMinimized }
}
}
`, { id: comment.data.node_id })