Skip to content

Commit e61c7c3

Browse files
authored
Merge branch 'main' into feature/issue-5826-create-observability-primer.md
2 parents 1979916 + 3684c03 commit e61c7c3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Survey on Merged PR by Non-Member
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
comment-on-pr:
9+
runs-on: ubuntu-latest
10+
if: github.event.pull_request.merged == true
11+
steps:
12+
- name: Check if user is a member of the org
13+
id: check-membership
14+
run: |
15+
USERNAME=$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH")
16+
ORG="${{ github.repository_owner }}"
17+
STATUS=$(gh api "orgs/$ORG/members/$USERNAME" --silent && echo "true" || echo "false")
18+
if [[ "$STATUS" == "true" ]]; then
19+
echo "MEMBER_FOUND=true" >> $GITHUB_ENV
20+
else
21+
echo "MEMBER_FOUND=false" >> $GITHUB_ENV
22+
fi
23+
env:
24+
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
25+
26+
- name: Add comment to PR if author is not a member
27+
if: env.MEMBER_FOUND == 'false'
28+
run: |
29+
PR_NUMBER=${{ github.event.pull_request.number }}
30+
gh pr comment $PR_NUMBER --body "Thank you for your contribution! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by filling out this survey: https://forms.gle/WV58koUBGSG9HBY66"

0 commit comments

Comments
 (0)