File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 22 pull_request :
33 types : [labeled, unlabeled]
44jobs :
5+ # When a PR is (un)labelled with awaiting-author or maintainer-merge,
6+ # add resp. remove the matching emoji reaction from zulip messages.
57 set_pr_emoji :
6- if : github.event.label.name == 'awaiting-author'
8+ if : github.event.label.name == 'awaiting-author' || github.event.label.name == 'maintainer-merge'
79 runs-on : ubuntu-latest
810 steps :
911 - name : Checkout mathlib repository
3032 PR_NUMBER : ${{ github.event.number}}
3133 LABEL_STATUS : ${{ github.event.action }}
3234 run : |
33- printf $'Running the python script with pr "%s"\n' "$PR_NUMBER"
35+ printf $'Running the python script with pr "%s"\n' "$PR_NUMBER" "$LABEL_STATUS"
3436 python scripts/zulip_emoji_merge_delegate.py "$ZULIP_API_KEY" "$ZULIP_EMAIL" "$ZULIP_SITE" "$LABEL_STATUS" "$PR_NUMBER"
Original file line number Diff line number Diff line change 7272 has_bors = any (reaction ['emoji_name' ] == 'bors' for reaction in reactions )
7373 has_merge = any (reaction ['emoji_name' ] == 'merge' for reaction in reactions )
7474 has_awaiting_author = any (reaction ['emoji_name' ] == 'writing' for reaction in reactions )
75+ has_maintainer_merge = any (reaction ['emoji_name' ] == 'hammer' for reaction in reactions )
7576 has_closed = any (reaction ['emoji_name' ] == 'closed-pr' for reaction in reactions )
7677 first_in_thread = hashPR .search (message ['subject' ]) and message ['display_recipient' ] == 'PR reviews' and message ['subject' ] not in first_by_subject
7778 first_by_subject [message ['subject' ]] = message ['id' ]
105106 "emoji_name" : "merge"
106107 })
107108 print (f"result: '{ result } '" )
109+ if has_maintainer_merge :
110+ print ('Removing maintainer-merge' )
111+ result = client .remove_reaction ({
112+ "message_id" : message ['id' ],
113+ "emoji_name" : "hammer"
114+ })
115+ print (f"result: '{ result } '" )
108116 if has_awaiting_author :
109117 print ('Removing awaiting-author' )
110118 result = client .remove_reaction ({
137145 "message_id" : message ['id' ],
138146 "emoji_name" : "peace_sign"
139147 })
148+ elif 'maintainer-merge' == LABEL :
149+ print ('adding maintainer-merge' )
150+ client .add_reaction ({
151+ "message_id" : message ['id' ],
152+ "emoji_name" : "hammer"
153+ })
140154 elif LABEL == 'labeled' :
141155 print ('adding awaiting-author' )
142156 client .add_reaction ({
You can’t perform that action at this time.
0 commit comments