Repository navigation
59 lines (56 loc) · 2.51 KB
/
Copy pathagent-roll.yml
File metadata and controls
59 lines (56 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Rolls Playwright Python to a new microsoft/playwright commit, the tip of main unless told
# otherwise. Starts the Playwright bot with the task below. The bot does it with the
# playwright-roll skill, and opens the pull request as the app.
name: "Agent: roll Playwright"
on:
# Mon, Wed and Fri at 9:17 UTC: 2:17 at night Pacific time, 1:17 in winter. Not on the hour, when
# GitHub delays scheduled runs. A scheduled roll skips while a roll pull request is open.
schedule:
- cron: "17 9 * * 1,3,5"
workflow_dispatch:
inputs:
ref:
description: "microsoft/playwright branch, tag or commit to roll to"
default: "main"
permissions: {}
jobs:
start:
name: Hand the task to the bot
if: github.repository == 'microsoft/playwright-python'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
pull-requests: read
steps:
# A manual run rolls anyway: a maintainer asked for it. The skill gives the title of a roll.
- name: Look for an open roll pull request
id: open
if: github.event_name == 'schedule'
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
pr=$(gh pr list --state open --author app/microsoft-playwright-automation --json number,title \
--jq '[.[] | select(.title | startswith("chore: roll Playwright to")) | .number] | first // empty')
if [[ -n "$pr" ]]; then
echo "pr=$pr" >> "$GITHUB_OUTPUT"
echo "Skipped: roll pull request #$pr is open." >> "$GITHUB_STEP_SUMMARY"
fi
- uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
if: steps.open.outputs.pr == ''
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
if: steps.open.outputs.pr == ''
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
REF: ${{ inputs.ref || 'main' }}
run: |
task="Roll Playwright Python to $REF of microsoft/playwright, as the playwright-roll skill, .claude/skills/playwright-roll/SKILL.md, says. When the roll is not complete, open the pull request anyway: the pin and the generated files are a start for a maintainer. Say in it what is left."
gh workflow run task.yml --repo microsoft/devops.playwright.dev --ref main \
-f repo="$GITHUB_REPOSITORY" -f task="$task"