From f8c8220418a7803f1b1bc27e6195dc0b3e59c6ac Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Mon, 9 Nov 2026 17:48:09 -0800 Subject: [PATCH] chore(bots): hand triage, review and tasks to the Playwright bot --- .github/workflows/agent-review.yml | 33 +++++++++++++++++++++++++++ .github/workflows/agent-task.yml | 36 ++++++++++++++++++++++++++++++ .github/workflows/agent-triage.yml | 36 ++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 .github/workflows/agent-review.yml create mode 100644 .github/workflows/agent-task.yml create mode 100644 .github/workflows/agent-triage.yml diff --git a/.github/workflows/agent-review.yml b/.github/workflows/agent-review.yml new file mode 100644 index 0000000..56f9ec9 --- /dev/null +++ b/.github/workflows/agent-review.yml @@ -0,0 +1,33 @@ +# Hands the pull request to the Playwright bot when a maintainer applies agent-review. Nothing +# else of the bot lives in this repo. Apply the label again to start another run. +name: "Agent: review" + +on: + # Runs from the default branch, for PRs from forks too. It never checks out the PR. + pull_request_target: + types: [labeled] + +permissions: {} + +jobs: + pr: + name: Hand the PR to the bot + if: github.repository_owner == 'microsoft' && github.event.label.name == 'agent-review' + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 + id: app-token + with: + client-id: ${{ vars.PLAYWRIGHT_APP_CLIENT_ID }} + private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }} + owner: microsoft + repositories: devops.playwright.dev + permission-actions: write + - name: Start the bot + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + NUMBER: ${{ github.event.pull_request.number }} + run: >- + gh workflow run pr.yml --repo microsoft/devops.playwright.dev --ref main + -f repo="$GITHUB_REPOSITORY" -f pr="$NUMBER" diff --git a/.github/workflows/agent-task.yml b/.github/workflows/agent-task.yml new file mode 100644 index 0000000..20f47cc --- /dev/null +++ b/.github/workflows/agent-task.yml @@ -0,0 +1,36 @@ +# Starts the Playwright bot with the task that you type. The bot does it with the skills of this +# repo, and opens the pull request as the app. Start it from the Actions tab. +name: "Agent: task" + +on: + workflow_dispatch: + inputs: + task: + description: What the bot should do + type: string + required: true + +permissions: {} + +jobs: + start: + name: Hand the task to the bot + if: github.repository == 'microsoft/playwright-pytest' + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 + id: app-token + with: + client-id: ${{ vars.PLAYWRIGHT_APP_CLIENT_ID }} + private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }} + owner: microsoft + repositories: devops.playwright.dev + permission-actions: write + - name: Start the bot + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + TASK: ${{ inputs.task }} + run: >- + gh workflow run task.yml --repo microsoft/devops.playwright.dev --ref main + -f repo="$GITHUB_REPOSITORY" -f task="$TASK" diff --git a/.github/workflows/agent-triage.yml b/.github/workflows/agent-triage.yml new file mode 100644 index 0000000..fb55521 --- /dev/null +++ b/.github/workflows/agent-triage.yml @@ -0,0 +1,36 @@ +# Hands the issue to the Playwright bot when a maintainer applies agent-triage or agent-implement. +# Nothing else of the bot lives in this repo. Apply the label again to start another run. +name: "Agent: triage" + +on: + issues: + types: [labeled] + +permissions: {} + +jobs: + issue: + name: Hand the issue to the bot + if: >- + github.repository_owner == 'microsoft' && ( + github.event.label.name == 'agent-triage' || + github.event.label.name == 'agent-implement') + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 + id: app-token + with: + client-id: ${{ vars.PLAYWRIGHT_APP_CLIENT_ID }} + private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }} + owner: microsoft + repositories: devops.playwright.dev + permission-actions: write + - name: Start the bot + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + NUMBER: ${{ github.event.issue.number }} + LABEL: ${{ github.event.label.name }} + run: >- + gh workflow run issue.yml --repo microsoft/devops.playwright.dev --ref main + -f repo="$GITHUB_REPOSITORY" -f issue="$NUMBER" -f label="$LABEL"