Skip to content

Commit efabff1

Browse files
authored
Resolve issue #7000 by adding PR labeler workflow (#7203)
* Add PR labeler workflow with size labeling (for now) This size labeling workflow should be a close approximation to what CirqBot currently does via `pr_monitor`. Once in place, it should be possible to remove pr_monitor from the Cirq code base, because the automerge functionality of pr_monitor (which is the other thing that it did) is now implemented using GitHub's merge queues. This basically resolves #7000. * Remove message for XL changes Review comments led to the conclusion that the message is unnecessary and more likely to be annoying than helpfu.
1 parent 586b3f6 commit efabff1

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/pr-labeler.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright 2025 The Cirq Developers
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
# Label PRs with labels such as size.
17+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18+
19+
name: Pull request labeler
20+
run-name: >-
21+
Label pull request ${{github.event.pull_request.number}} by ${{github.actor}}
22+
23+
on:
24+
pull_request:
25+
types: [opened]
26+
27+
# Allow manual invocation.
28+
workflow_dispatch:
29+
30+
# Declare default permissions as read only.
31+
permissions: read-all
32+
33+
jobs:
34+
label-pr-size:
35+
name: Add size label to new pull request
36+
runs-on: ubuntu-24.04
37+
permissions:
38+
contents: read
39+
pull-requests: write
40+
issues: write
41+
steps:
42+
- name: Label the PR with a size label
43+
uses: codelytv/pr-size-labeler@c7a55a022747628b50f3eb5bf863b9e796b8f274 # v1
44+
with:
45+
# Don't count file deletions, per suggestion in Small CLs.
46+
ignore_file_deletions: 'true'
47+
48+
xs_label: 'Size: XS'
49+
xs_max_size: '10'
50+
51+
s_label: 'size: S'
52+
s_max_size: '50'
53+
54+
m_label: 'size: M'
55+
m_max_size: '250'
56+
57+
l_label: 'size: L'
58+
l_max_size: '1000'
59+
60+
xl_label: 'size: XL'
61+
fail_if_xl: 'false'

0 commit comments

Comments
 (0)