Added common parent class for multi-select #34
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
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: Confirm PR_NOTIFICATION Secret is Set | |
run: | | |
if [[ -z "${{ secrets.PR_NOTIFICATION }}" ]]; then | |
echo "PR_NOTIFICATION secret is not set." | |
else | |
echo "PR_NOTIFICATION secret is set." | |
fi | |
- name: Send notification to Google Chat | |
uses: fjogeleit/[email protected] | |
with: | |
url: ${{ secrets.PR_NOTIFICATION }} | |
method: POST | |
contentType: application/json | |
data: | | |
{ | |
"cards": [ | |
{ | |
"header": { | |
"title": "Open source: 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 }}" | |
} | |
} | |
} | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |