Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…icro-front-ends into Feature/FWF-3620-History-component
  • Loading branch information
Ajay-aot committed Oct 28, 2024
2 parents 5d927d2 + 6c3ed16 commit 03a4a95
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/pr-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: PR Notification to Google Chat

on:
pull_request:
types: [opened, synchronize, closed]
branches:
- develop

jobs:
notify:
runs-on: ubuntu-latest
if: github.repository == 'AOT-Technologies/forms-flow-ai-micro-front-ends'

steps:
- name: Determine PR Status
id: pr_status
run: |
if [[ "${{ github.event.action }}" == "opened" ]]; then
echo "status=🟢 Open" >> $GITHUB_ENV
elif [[ "${{ github.event.action }}" == "closed" && "${{ github.event.pull_request.merged }}" == "true" ]]; then
echo "status=🟣 Merged" >> $GITHUB_ENV
elif [[ "${{ github.event.action }}" == "closed" ]]; then
echo "status=🔴 Closed" >> $GITHUB_ENV
else
echo "status=🟢 Open" >> $GITHUB_ENV
fi
- name: Send notification to Google Chat
uses: fjogeleit/[email protected]
with:
url: ${{ secrets.WEBHOOK }}
method: POST
contentType: application/json
data: |
{
"cards": [
{
"header": {
"title": "Micro front-ends: Pull Request Opened by ${{ github.event.pull_request.user.login }}",
"subtitle": "Pull Request #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}",
"imageUrl": "${{ github.event.pull_request.user.avatar_url }}"
},
"sections": [
{
"widgets": [
{
"textParagraph": {
"text": "Repository: ${{ github.repository }}"
}
},
{
"textParagraph": {
"text": "Status: ${{ env.status }}"
}
},
{
"buttons": [
{
"textButton": {
"text": "View Pull Request",
"onClick": {
"openLink": {
"url": "${{ github.event.pull_request.html_url }}"
}
}
}
}
]
}
]
}
]
}
]
}

0 comments on commit 03a4a95

Please sign in to comment.