Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Turn pushes into polished client updates. Summarizes recent commit messages and emails a professional brief on every main push.

Notifications You must be signed in to change notification settings

Austin1serb/Serbyte-Actions

Repository files navigation

Commit-Email-Action

Turn every commit into a polished status update — automatically.
Summarises Git commit messages with OpenAI and e-mails your clients the results via any SMTP account, wrapped in a beautiful HTML template.


✨ Why use this action?

Feature Description
AI-quality summaries Converts raw commit messages into concise, client-friendly prose using your chosen OpenAI model.
Drop-in reusable Consume with one line of YAML (uses: serbyte/commit-email-action@v1) from any repository.
SMTP Works only with Gmail at this time (via dawidd6/action-send-mail).
Production-grade build Self-contained bundle — no runtime file reads, no external assets.
Security first All credentials injected via GitHub Secrets; nothing hard-coded.

🏗 Repository layout

Serbyte Actions/
├─ dist/              # compiled bundle (checked-in after build)
├─ src/
│  ├─ index.ts        # action logic
│  ├─ prompt.md       # system prompt
│  ├─ email.html      # HTML template (uses {{BODY}}) and {{REPO_NAME}}
│  └─ test.ts         # local dry-run harness
├─ scripts/embed-assets.ts  # embeds prompt & template into assets.ts
├─ action.yml         # Action entrypoint
├─ .github/workflows/release.yml
└─ package.json

🔧 Inputs

Name Required Default Description
openai-model gpt-4o-mini Any chat-completion model ID understood by the OpenAI API.

🔐 Secrets

Secret Purpose
OPENAI_API_KEY Auth for OpenAI Chat Completions.
EMAIL_USERNAME SMTP user (e.g. Gmail address).
EMAIL_PASSWORD SMTP password / app-specific password / token.
EMAIL_TO Comma-separated list of recipient addresses.

(Add at org or repo level → Settings → Secrets → Actions.)


⚡ Quick start (workflow_call style)

# .github/workflows/commit-emailer.yml
name: Client Updates
on:
  push:
    branches: [main]

jobs:
  notify:
    uses: serbyte/commit-email-action/.github/workflows/send_commit_email.yml@v1
    secrets: inherit    # passes OPENAI & SMTP secrets through

That’s all you need in each project repo.


📄 Full reusable workflow (send_commit_email.yml)

If you prefer to copy instead of uses::

name: Summarise & E-mail
on:
  push:
    branches: [main]

jobs:
  send:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: serbyte/commit-email-action@v1
        id: summarize
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

      - name: Send e-mail
        uses: dawidd6/action-send-mail@v3
        with:
          server_address: smtp.gmail.com
          server_port: 465
          username: ${{ secrets.EMAIL_USERNAME }}
          password: ${{ secrets.EMAIL_PASSWORD }}
          subject: "🚀 Update for ${{ github.repository }} – ${{ github.ref_name }}"
          to: ${{ secrets.EMAIL_TO }}
          from: Serbyte Bot <${{ secrets.EMAIL_USERNAME }}>
          content_type: text/html
          body: ${{ steps.summarize.outputs.email_body }}

🧑‍💻 Local development

# Install deps
npm ci

# Dry-run with mock commits (requires OPENAI_API_KEY in env)
npm run local-test

# Build bundle (embeds assets & compiles)
npm run build

🚀 Release workflow

Every push to main:

  1. Runs npm run build.
  2. Verifies dist/ is clean.
  3. Tags commit with version from package.json (v1.2.3) and moves the floating v1 tag.
  4. Publishes a GitHub Release with autogenerated notes.
    (See .github/workflows/release.yml for details.)

Bump versions with standard npm commands:

npm version patch   # or minor / major
git push

📝 Template & prompt customisation

  • src/email.html — edit freely; keep the single {{BODY}} placeholder.
  • src/prompt.md — tweak summarisation rules or examples.
  • Run npm run build and commit the updated dist/ to ship changes.

🙌 Contributing

  1. Fork & clone.
  2. npm ci && npm run local-test.
  3. Make changes, add tests.
  4. npm run build and commit both src/ and dist/.
  5. Open a PR.

📜 License

MIT

Built with ❤️ by Serbyte — Let your code speak for itself.

About

Turn pushes into polished client updates. Summarizes recent commit messages and emails a professional brief on every main push.

Resources

Stars

Watchers

Forks

Packages

No packages published