Skip to content

Commit b3029e4

Browse files
committed
[GH] Add review expectations comment
1 parent f63960a commit b3029e4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Set review expectations
2+
3+
# **What it does**: Adds a comment to newly created PRs.
4+
# **Why we have it**: Sets an expectation internally and externally for how fast we should be getting to something. Reduces questions internally.
5+
# **Who does it impact**: Cloudflare contributors / external contributors
6+
7+
on:
8+
pull_request_target:
9+
types:
10+
- opened
11+
12+
jobs:
13+
review_comment:
14+
name: Add review comment
15+
runs-on: ubuntu-latest
16+
steps:
17+
- id: check_if_contributor_is_external
18+
name: Check if contributor is external
19+
run: 'curl --write-out ''%{http_code}'' --silent --output /dev/null -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ env.GH_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/orgs/cloudflare/members/${{ github.event.pull_request.user.login }} | grep -q ''204'' && echo "is_external=false" >> $GITHUB_OUTPUT || echo "is_external=true" >> $GITHUB_OUTPUT'
20+
env:
21+
GH_TOKEN: ${{ secrets.HOLOPIN_LABELER }}
22+
- name: External comment
23+
run: gh pr comment "$NUMBER" --body "Howdy and thanks for contributing to our repo.\n\nWe generally get around to reviewing new, external PRs within **2 weeks**.\n\nIf it's been longer than then without any movement, try tagging the **Assignees** in a comment."
24+
if: steps.check_if_contributor_is_external.outputs.is_external == 'true'
25+
- name: External comment
26+
run: gh pr comment "$NUMBER" --body "Howdy and thanks for contributing to our repo.\n\nWe generally get around to reviewing internal PRs with **1 week**. If it's something urgent or has been sitting without any movement for more than that, start a thread in the `Developer Docs` space internally."
27+
if: steps.check_if_contributor_is_external.outputs.is_external == 'false'

0 commit comments

Comments
 (0)