Skip to content

Commit e3c3e51

Browse files
committed
Sync auto-copilot-org-playwright-loop.yaml from .github repo
1 parent 815995c commit e3c3e51

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "Org-wide: Copilot Playwright Test, Review, Auto-fix, PR, Merge"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
playwright-review-fix:
11+
runs-on: ubuntu-latest
12+
steps:
13+
# Checkout repository code
14+
- name: Checkout code
15+
uses: actions/checkout@main
16+
17+
# Set up Python (change/add for other stacks!)
18+
- name: Setup Python
19+
uses: actions/setup-python@main
20+
with:
21+
python-version: "3.11"
22+
23+
# Install dependencies (Python example)
24+
- name: Install dependencies
25+
run: |
26+
pip install -r requirements.txt
27+
pip install pytest playwright pytest-playwright
28+
29+
# Install Playwright browsers
30+
- name: Install Playwright browsers
31+
run: |
32+
python -m playwright install
33+
34+
# Run Playwright tests
35+
- name: Run Playwright Tests
36+
run: |
37+
pytest tests/ || exit 1
38+
continue-on-error: true
39+
40+
# Copilot PR Agent auto-review (if available for org)
41+
- name: Copilot PR Agent Review
42+
uses: github/copilot-agent/pr@main
43+
with:
44+
github-token: ${{ secrets.GITHUB_TOKEN }}
45+
continue-on-error: true
46+
47+
# Copilot Agent auto-fix (can loop up to N attempts if tests fail)
48+
- name: Copilot Auto-fix Failing Playwright Tests
49+
uses: github/copilot-agent/fix@main
50+
with:
51+
github-token: ${{ secrets.GITHUB_TOKEN }}
52+
max_attempts: 3 # Try up to 3 auto-fix loops!
53+
continue-on-error: true
54+
55+
# Create PR with fixes (if any)
56+
- name: Create Pull Request for Automated Fixes
57+
uses: peter-evans/create-pull-request@main
58+
with:
59+
branch: "copilot/playwright-fixes"
60+
title: "Copilot: Auto-fix Playwright Tests"
61+
body: "Automated Playwright test fixes by Copilot Agent."
62+
commit-message: "Copilot agent Playwright bugfixes"
63+
continue-on-error: true
64+
65+
# Automerge PR if passing
66+
- name: Automerge PR if checks pass
67+
uses: pascalgn/automerge-action@main
68+
with:
69+
merge-method: squash
70+
github-token: ${{ secrets.GITHUB_TOKEN }}
71+
continue-on-error: true

0 commit comments

Comments
 (0)