Skip to content

Delete run_2026-07-16 165731.png #17

Delete run_2026-07-16 165731.png

Delete run_2026-07-16 165731.png #17

Workflow file for this run

name: Automated Admin Commit Notification
on:
push:
branches: ["master"]
permissions:
contents: read
jobs:
notify-admin:
runs-on: ubuntu-latest
environment:
name: main
steps:
- name: Checkout Code with Full History
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Generate Commit Message and Diff Data
id: git_details
run: |
echo "COMMIT_MSG=$(git log -1 --pretty=format:'%s')" >> $GITHUB_ENV
echo "COMMIT_AUTHOR=$(git log -1 --pretty=format:'%an')" >> $GITHUB_ENV
echo "GIT_DIFF<<EOF" >> $GITHUB_ENV
git diff HEAD~1 HEAD | head -n 100 >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Send Email Notification to Admin
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
subject: "Commit Notification: Push by ${{ env.COMMIT_AUTHOR }}"
to: eamon112009@gmail.com
from: GitHub Automation Engine
body: |
Hello Admin,
A new commit has been successfully pushed to the repository.
Commit Message:
"${{ env.COMMIT_MSG }}"
Pushed By:
${{ env.COMMIT_AUTHOR }}
Code Changes Summary (Diff Preview):
--------------------------------------------------
${{ env.GIT_DIFF }}
--------------------------------------------------
View full logs directly inside the GitHub Actions pipeline interface.