| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- name: GSI Chatroom PR Notification
- on:
- pull_request:
- types: [review_requested]
- jobs:
- notify-pull-request:
- runs-on: ubuntu-latest
- steps:
- - name: Pull Request Details
- run: |
- echo "Pull Request: ${{ github.event.pull_request.number }}"
- echo "Author: ${{ github.event.pull_request.user.login }}"
- - name: Google Chat Notification
- shell: bash
- env:
- TITLE: ${{ github.event.pull_request.title }}
- LABELS: ${{ join(github.event.pull_request.labels.*.name, ', ') }}
- run: |
- curl --location --request POST '${{ secrets.WEBHOOK_URL }}' \
- --header 'Content-Type: application/json' \
- --data-raw '{
- "cards": [
- {
- "header": {
- "title": "Pull request notification",
- "subtitle": "Pull request: #${{ github.event.pull_request.number }}"
- },
- "sections": [
- {
- "widgets": [
- {
- "keyValue": {
- "topLabel": "Repo",
- "content": "${{ github.event.pull_request.head.repo.full_name }}"
- }
- },
- {
- "keyValue": {
- "topLabel": "Title",
- "content": "'"$TITLE"'"
- }
- },
- {
- "keyValue": {
- "topLabel": "Creator",
- "content": "${{ github.event.pull_request.user.login }}"
- }
- },
- {
- "keyValue": {
- "topLabel": "State",
- "content": "${{ github.event.pull_request.state }}"
- }
- },
- {
- "keyValue": {
- "topLabel": "Assignees",
- "content": "- ${{ join(github.event.pull_request.assignees.*.login, ', ') }}"
- }
- },
- {
- "keyValue": {
- "topLabel": "Reviewers",
- "content": "- ${{ join(github.event.pull_request.requested_reviewers.*.login, ', ') }}"
- }
- },
- {
- "keyValue": {
- "topLabel": "Labels",
- "content": "- '"$LABELS"'"
- }
- },
- {
- "buttons": [
- {
- "textButton": {
- "text": "Open Pull Request",
- "onClick": {
- "openLink": {
- "url": "${{ github.event.pull_request.html_url }}"
- }
- }
- }
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }'
|