-
-
Notifications
You must be signed in to change notification settings - Fork 0
22 lines (22 loc) · 1.34 KB
/
commits.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
name: Push Commits to Discord Webhook
on:
push:
paths-ignore:
- '.github/**'
jobs:
Discord_Notification:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set enviroment
shell: bash
run: |
echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV"
- name: Discord Commits
uses: Sniddl/[email protected]
with:
webhook: ${{ secrets.DISCORD_COMMITS_WEBHOOK }}
message: "\u200B"
embed: '{"title": "**{{ commit.title }}**","description": "{{ commit.description }}\u200B","author": {"name": "{{ commit.author.username }}","icon_url": "https://github.com/{{ commit.author.username }}.png","url": "https://github.com/{{ commit.author.username }}"},"image": {"url": "https://repository-images.githubusercontent.com/482364703/3140862c-8faf-45cd-bd5f-7f62968dbd23"},"fields": [{"name": "AddOn","value": "[{{ github.context.payload.repository.name}}]({{ github.context.payload.repository.html_url }})","inline": true},{"name": "Branch","value": "${{ env.branch }}","inline": true},{"name": "SHA","value": "[${{ env.sha_short }}]({{ commit.url }})","inline": true},{"name": "Diff","value": "[Show Diff]({{ github.context.payload.compare }})","inline": true}]}'