File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 88 notify :
99 runs-on : ubuntu-latest
1010 steps :
11- - name : Check if PR was merged
11+ - name : Get GitHub User Name
12+ id : get_username
13+ run : |
14+ USERNAME=$(curl -s "https://api.github.com/users/${{ github.actor }}" | jq -r '.name')
15+ if [ "$USERNAME" == "null" ]; then
16+ USERNAME="${{ github.actor }}"
17+ fi
18+ echo "USERNAME=$USERNAME" >> $GITHUB_ENV
19+
20+ - name : Send Slack Notification
1221 if : github.event.pull_request.merged == true
1322 uses : rtCamp/action-slack-notify@v2
1423 env :
1524 SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK_URL }}
1625 SLACK_MESSAGE : |
17- ✅ PR Merged!
18- 🔗 Repository: ` ${{ github.repository }}`
19- 🛠 Merged by: `${{ github.actor }}`
20- 🚀 PR Title: `${{ github.event.pull_request.title }}`
21- 📝 PR Description: ` ${{ github.event.pull_request.body }}`
22- 🔗 PR URL: ${{ github.event.pull_request.html_url }}
26+ ✅ * PR Merged!*
27+ 🚀 * ${{ github.event.pull_request.title }}*
28+ 🛠 Merged by: `${{ env.USERNAME }}`
29+ 📝 Description:
30+ - ${{ github.event.pull_request.body }}
31+ 🔗 * PR URL:* ${{ github.event.pull_request.html_url }}
2332 SLACK_USERNAME : " GitHub Actions"
2433 SLACK_ICON_EMOJI : " :white_check_mark:"
Original file line number Diff line number Diff line change 1+ # Github Action Test
2+
You can’t perform that action at this time.
0 commit comments