Skip to content

Update main.yml

Update main.yml #5

Workflow file for this run

name: Discord Notification
on:
push:
branches:
- main
jobs:
discord:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get commit details
id: get_commit
run: |
echo "MESSAGE=$(git log -1 --pretty=format:'%s')" >> $GITHUB_ENV
echo "COMMITTER=$(git log -1 --pretty=format:'%cn')" >> $GITHUB_ENV
echo "URL=https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA" >> $GITHUB_ENV
- name: Send Discord notification
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
username: 'GitHub Actions Bot'
message: New commit on the main branch ${{ env.MESSAGE }} by ${{ env.COMMITTER }}.