Skip to content

Commit

Permalink
fix: Discord notification on push to main
Browse files Browse the repository at this point in the history
* test: multiline commit message test

* test: special character `${ }':"
  • Loading branch information
chubei committed Feb 23, 2023
1 parent cf49da5 commit 7e5c0e4
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Dozer Coverage

on:
push:
branches: [main]
branches: [main, coverage-yaml-dev]
pull_request:
branches: [main]

Expand Down Expand Up @@ -99,3 +99,22 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ steps.coverage.outputs.report }}

discord_notification:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_GITHUB_WEBOOK }}
DISCORD_EMBEDS: '[ {
"title": " ${{ github.actor }} pushed to `${{ github.ref_name }}` :rocket:",
"author": { "icon_url": "https://avatars.githubusercontent.com/${{ github.actor }}", "name": "${{ github.actor }}", "url": "https://github.com/${{ github.actor }}" },
"fields": [
{ "name": "Commit", "value": "[${{ github.event.head_commit.id }}](${{ github.event.head_commit.url }})"},
{ "name": "Repository", "value": "[getdozer/dozer](https://github.com/getdozer/dozer)" },
{ "name": "Message", "value": "${{ toJSON(github.event.head_commit.message) }}"}
],
"color": 990099
}]'
uses: Ilshidur/action-discord@master

0 comments on commit 7e5c0e4

Please sign in to comment.