Skip to content

Commit 743891a

Browse files
authored
chore: hand agent-fix issues to the Playwright bots (#524)
Applying `agent-fix`, `agent-fix-mac` or `agent-fix-win` to an issue dispatches the bots workflow in microsoft/devops.playwright.dev, which triages the issue there and proposes the fix as a draft PR, here or in microsoft/playwright, where the source of the CLI is. Nothing else of the bots lives in this repo. `needs-triage` and `needs-revision` keep running `triage.yml` and `revision.yml` here for now; this is the first label that the bots take over. Uses the same `PLAYWRIGHT_APP_CLIENT_ID` and `PLAYWRIGHT_PRIVATE_KEY` as `triage.yml`, with `actions: write` on devops.playwright.dev only.
1 parent 4bc00fb commit 743891a

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

‎.github/workflows/bots.yml‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# The Playwright bots run in microsoft/devops.playwright.dev. This workflow hands them the request
2+
# when a maintainer applies agent-fix, agent-fix-mac or agent-fix-win to an issue: it dispatches
3+
# bots.yml there with the repo, the issue number, the label and who applied it. The bot triages the
4+
# issue there and proposes the fix as a draft PR, in this repo or in microsoft/playwright, where the
5+
# source of the CLI is. Re-apply the label to start another run. needs-triage and needs-revision
6+
# still run triage.yml and revision.yml here, until the bots take those over too.
7+
#
8+
# Its source is bots/shim.yml in microsoft/devops.playwright.dev, and bots/README.md there
9+
# describes the system.
10+
name: Bots
11+
12+
on:
13+
issues:
14+
types: [labeled]
15+
16+
permissions: {}
17+
18+
jobs:
19+
dispatch:
20+
name: Hand the request to the bots
21+
if: github.repository_owner == 'microsoft' && startsWith(github.event.label.name, 'agent-fix')
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 5
24+
steps:
25+
- uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
26+
id: app-token
27+
with:
28+
client-id: ${{ vars.PLAYWRIGHT_APP_CLIENT_ID }}
29+
private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }}
30+
owner: microsoft
31+
repositories: devops.playwright.dev
32+
permission-actions: write
33+
- name: Dispatch bots.yml in microsoft/devops.playwright.dev
34+
env:
35+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
36+
NUMBER: ${{ github.event.issue.number }}
37+
LABEL: ${{ github.event.label.name }}
38+
SENDER: ${{ github.event.sender.login }}
39+
run: >-
40+
gh workflow run bots.yml --repo microsoft/devops.playwright.dev --ref main
41+
-f repo="$GITHUB_REPOSITORY" -f number="$NUMBER" -f label="$LABEL" -f requested_by="$SENDER"

0 commit comments

Comments
 (0)