Skip to content

Commit

Permalink
fix pr alert (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
iambeone authored Feb 7, 2020
1 parent 5b4e0c9 commit 26d0cab
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
name: AlertOnPR

on:
on:
pull_request:
types: [opened]
jobs:
test:
name: Compile
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: 'pr_alerts'
SLACK_USERNAME: 'luniebot'
SLACK_ICON: 'https://emoji.slack-edge.com/TH6F97TDF/lunie/4ac63c1d435c04dc.png'
SLACK_MESSAGE: ${{ github.event.pull_request.title }} | ${{ github.event.pull_request.body }} | ${{ github.event.pull_request._links.html.href }}
- name: curl message
run: |
curl -X POST ${{ secrets.SLACK_WEBHOOK }} \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary "
{
\"channel\": \"#pr_alerts\",
\"username\": \"pr_alert\",
\"icon_url\": \"https://emoji.slack-edge.com/TH6F97TDF/lunie/4ac63c1d435c04dc.png\",
\"attachments\": [
{
\"fallback\": \"Required plain-text summary of the attachment.\",
\"color\": \"#36a64f\",
\"author_name\": \"${{github.event.pull_request.user.login}}\",
\"author_link\": \"${{github.event.pull_request.user.url}}\",
\"author_icon\": \"${{github.event.pull_request.user.avatar_url}}\",
\"title\": \"${{github.event.pull_request.title}}\",
\"title_link\": \"${{github.event.pull_request.html_url}}\",
\"text\": \"${{github.event.pull_request.body}}\",
\"fields\": [
{
\"title\": \"Repo\",
\"value\": \"${{github.event.repository.full_name}}\",
\"short\": false
}
]
}
]
}"

0 comments on commit 26d0cab

Please sign in to comment.