Skip to content

Commit cca0bc2

Browse files
committed
devops(roll): roll on Mon, Wed and Fri at night, unless a roll PR is open
1 parent 5e3e021 commit cca0bc2

2 files changed

Lines changed: 28 additions & 4 deletions

File tree

‎.github/workflows/roll.yml‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
# Apply needs-roll to an issue to roll to the tip of main; re-apply it to trigger another roll.
1212
issues:
1313
types: [labeled]
14+
# Mon, Wed and Fri at 9:17 UTC: 2:17 at night Pacific time, 1:17 in winter. Not on the hour, when
15+
# GitHub delays scheduled runs. A scheduled roll skips while a roll pull request is open.
16+
schedule:
17+
- cron: "17 9 * * 1,3,5"
1418
workflow_dispatch:
1519
inputs:
1620
ref:
@@ -48,14 +52,17 @@ jobs:
4852
name: Find the commit
4953
if: >-
5054
github.repository == 'microsoft/playwright-python' &&
51-
(github.event_name == 'workflow_dispatch' || github.event.label.name == 'needs-roll')
55+
(github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ||
56+
github.event.label.name == 'needs-roll')
5257
runs-on: ubuntu-24.04
5358
permissions:
5459
contents: read
60+
pull-requests: read
5561
outputs:
5662
old_commit: ${{ steps.versions.outputs.old_commit }}
5763
new_commit: ${{ steps.versions.outputs.new_commit }}
5864
new_short: ${{ steps.versions.outputs.new_short }}
65+
open_roll: ${{ steps.open.outputs.pr }}
5966
steps:
6067
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6168
- name: Read the pinned and the new commit
@@ -71,11 +78,27 @@ jobs:
7178
echo "new_commit=${new_commit}"
7279
echo "new_short=${new_commit:0:10}"
7380
} >> "$GITHUB_OUTPUT"
81+
# A label or a manual run rolls anyway: a maintainer asked for it.
82+
- name: Look for an open roll pull request
83+
id: open
84+
if: github.event_name == 'schedule'
85+
env:
86+
GH_TOKEN: ${{ github.token }}
87+
GH_REPO: ${{ github.repository }}
88+
run: |
89+
pr=$(gh pr list --state open --author app/microsoft-playwright-automation --json number,headRefName \
90+
--jq '[.[] | select(.headRefName | startswith("roll/")) | .number] | first // empty')
91+
if [[ -n "$pr" ]]; then
92+
echo "pr=$pr" >> "$GITHUB_OUTPUT"
93+
echo "Skipped: roll pull request #$pr is open." >> "$GITHUB_STEP_SUMMARY"
94+
fi
7495
7596
roll:
7697
name: Roll to ${{ needs.versions.outputs.new_short }}
7798
needs: versions
78-
if: needs.versions.outputs.new_commit != needs.versions.outputs.old_commit
99+
if: >-
100+
needs.versions.outputs.new_commit != needs.versions.outputs.old_commit &&
101+
needs.versions.outputs.open_roll == ''
79102
# The runner of CI: the skill runs ./test.sh, both suites on all its cores.
80103
runs-on: playwright-x64-ubuntu24-64-core
81104
timeout-minutes: 240

‎AGENTS.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ left).
139139
## Rolls
140140

141141
Use the `playwright-roll` skill. On CI, `.github/workflows/roll.yml` runs it and opens the
142-
PR. Apply the `needs-roll` label to an issue to roll to the tip of `main`, or start the
143-
workflow by hand with a branch, a tag or a commit.
142+
PR. It runs on Mon, Wed and Fri at night, unless a roll PR is open. Apply the `needs-roll`
143+
label to an issue to roll to the tip of `main`, or start the workflow by hand with a
144+
branch, a tag or a commit.
144145

145146
## Commits and PRs
146147

0 commit comments

Comments
 (0)