Skip to content

Commit 28ee20f

Browse files
committed
ci: add SDK review relay workflow
Forward pull_request_review events (changes_requested / comments) on [AUTO] PRs to gdc-nas via repository_dispatch, so the sync pipeline can react to reviewer feedback automatically.
1 parent b65ee3f commit 28ee20f

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# =============================================================================
2+
# SDK Review Relay
3+
#
4+
# Minimal relay that forwards pull_request_review events to gdc-nas,
5+
# where the actual review-fix logic runs. Only fires for [AUTO] PRs
6+
# created by the SDK sync pipeline.
7+
#
8+
# SECRETS
9+
# -------
10+
# TOKEN_GITHUB_YENKINS_ADMIN — PAT with repo scope on gdc-nas
11+
# (needed for repository_dispatch)
12+
# =============================================================================
13+
name: SDK Review Relay
14+
15+
on:
16+
pull_request_review:
17+
types: [submitted]
18+
19+
jobs:
20+
relay:
21+
name: "Forward review to gdc-nas"
22+
if: >-
23+
(github.event.review.state == 'changes_requested'
24+
|| (github.event.review.state == 'commented' && github.event.review.body))
25+
&& github.event.pull_request.user.login == 'yenkins-admin'
26+
&& startsWith(github.event.pull_request.head.ref, 'feature/auto-P')
27+
&& github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 2
30+
steps:
31+
- name: Dispatch to gdc-nas
32+
env:
33+
GH_TOKEN: ${{ secrets.TOKEN_GITHUB_YENKINS_ADMIN }}
34+
run: |
35+
gh api "repos/gooddata/gdc-nas/dispatches" \
36+
--method POST \
37+
-f event_type="sdk-review-submitted" \
38+
-f "client_payload[pr_number]=${{ github.event.pull_request.number }}" \
39+
-f "client_payload[pr_branch]=${{ github.event.pull_request.head.ref }}" \
40+
-f "client_payload[pr_author]=${{ github.event.pull_request.user.login }}" \
41+
-f "client_payload[reviewer]=${{ github.event.review.user.login }}" \
42+
-f "client_payload[review_id]=${{ github.event.review.id }}" \
43+
-f "client_payload[review_state]=${{ github.event.review.state }}" \
44+
-f "client_payload[review_body]=${{ github.event.review.body }}"
45+
46+
echo "## Dispatched to gdc-nas" >> "$GITHUB_STEP_SUMMARY"
47+
echo "- PR: #${{ github.event.pull_request.number }}" >> "$GITHUB_STEP_SUMMARY"
48+
echo "- Reviewer: ${{ github.event.review.user.login }}" >> "$GITHUB_STEP_SUMMARY"
49+
echo "- State: ${{ github.event.review.state }}" >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)