Skip to content

Commit dd53d09

Browse files
authored
Merge pull request #65 from Code-dot-mil/hshah-mitre-patch-1
Add final reviewer notification to deploy workflow
2 parents 12169cc + cf405f7 commit dd53d09

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ on:
77
- "*"
88

99
pull_request:
10-
types: [opened, ready_for_review, synchronize]
10+
types: [opened, ready_for_review, synchronize]
11+
12+
pull_request_review:
13+
types: [submitted]
14+
1115

1216
permissions:
1317
contents: read # This is required for actions/checkout
@@ -73,7 +77,24 @@ jobs:
7377
-H "Content-Type: application/json" \
7478
-d '{"team_reviewers":["ai4sdlc-reviewers"]}' \
7579
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers
76-
80+
81+
notify_final_reviewer:
82+
runs-on: ubuntu-latest
83+
if: github.event_name == 'pull_request_review'
84+
steps:
85+
- name: Notify final reviewer team
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
run: |
89+
PR_NUMBER=${{ github.event.pull_request.number }}
90+
REVIEWER=${{ github.event.review.user.login }}
91+
TEAM_HANDLE="@${{ github.repository_owner }}/ai4sdlc-approval"
92+
COMMENT="$TEAM_HANDLE PR #$PR_NUMBER has been approved by @$REVIEWER and is ready for final review."
93+
curl -X POST \
94+
-H "Authorization: token $GITHUB_TOKEN" \
95+
-H "Accept: application/vnd.github+json" \
96+
-d "{\"body\": \"$COMMENT\"}" \
97+
https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments
7798
# Build stage - converting md file to html using MkDocs
7899
convert_md_to_html:
79100
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)