Skip to content

Commit f577317

Browse files
committed
Make PR dashboard near-real-time with event triggers
Trigger the workflow on PR/review/comment events in addition to the hourly cron, and add a concurrency group that debounces bursts (at most one running and one queued) without canceling the in-flight run.
1 parent fd994a6 commit f577317

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

.github/workflows/pr-review-dashboard.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,44 @@ name: PR dashboard
22

33
on:
44
schedule:
5-
# hourly
5+
# hourly safety net
66
- cron: "0 * * * *"
77
workflow_dispatch:
8+
pull_request_target:
9+
types:
10+
- opened
11+
- reopened
12+
- closed
13+
- ready_for_review
14+
- converted_to_draft
15+
- labeled
16+
- unlabeled
17+
- synchronize
18+
- review_requested
19+
- review_request_removed
20+
pull_request_review:
21+
types: [submitted, dismissed, edited]
22+
pull_request_review_comment:
23+
types: [created]
24+
issue_comment:
25+
types: [created]
26+
27+
# Debounce bursts of PR events without canceling the in-flight run: at most
28+
# one run executes and one is queued. If more events arrive while a run is
29+
# queued, the older queued run is replaced by the newer one, so events
30+
# coalesce instead of stacking up indefinitely.
31+
concurrency:
32+
group: pr-review-dashboard
33+
cancel-in-progress: false
834

935
permissions:
1036
contents: read
1137

1238
jobs:
1339
update-dashboard:
40+
# Skip issue_comment events that aren't on a PR (the event fires for both
41+
# issues and PRs, but only PR comments affect the dashboard).
42+
if: ${{ github.event_name != 'issue_comment' || github.event.issue.pull_request != null }}
1443
permissions:
1544
issues: write
1645
environment: protected

0 commit comments

Comments
 (0)