FWF-3882 [Bugfix] Fixes for reirection issue for view_submissions only user and multitenancy case in common router helper file #223
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_target: | |
types: [opened, synchronize, closed] | |
branches: | |
- develop | |
jobs: | |
notify: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.pull_request.base.repo.full_name == 'AOT-Technologies/forms-flow-ai' && github.event.pull_request.draft == false }} | |
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.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 }}" | |
} | |
} | |
} | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
] | |
} |