Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

15 Commits

Repository files navigation

workflows

A centralized collection of reusable GitHub Actions workflows and automation templates for ACEP.

Mattermost Notification Workflow

This reusable workflow standardizes Mattermost alerts across different repositories. It supports presets for common events like Pull Request reviews and Job Status updates.

🚀 Usage

To use this workflow, create a job in your caller workflow (e.g., .github/workflows/deploy.yml).

Inputs

InputDescriptionRequiredDefault
presetType of message: status, review_request, review_decision, or custom.Nocustom
job_statusThe result of the previous job (success, failure, other). Required for status.NoN/A
titleOverrides the prefix in status messages (e.g., "Production Deploy").NoAction
messageAppends a custom string or note to the bottom of any preset.No""

Secrets

SecretDescriptionRequired
MM_WEBHOOK_URLThe incoming webhook URL from your Mattermost channel, set this as a repository secret.Yes

Pull Request Notifications (Requests & Decisions)

Use this combined workflow to handle both new review requests and submitted review decisions (Approvals/Changes Requested).

name: PR Notificationson:
pull_request:
types: [review_requested]pull_request_review:
types: [submitted]jobs:
# Triggered when a reviewer is specifically requestednotify-on-request:
if: github.event.action == 'review_requested'uses: acep-devops/workflows/.github/workflows/mattermost-notify.yml@mainwith:
preset: "review_request"secrets:
MM_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}# Triggered when a reviewer submits an Approval or Changes Requestednotify-on-submit:
if: github.event.action == 'submitted'uses: acep-devops/workflows/.github/workflows/mattermost-notify.yml@mainwith:
preset: "review_decision"secrets:
MM_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}

Example Outputs

👀 Review Requested
Repo: RepoName
PR: PR# - PR Title
Requested By: ReviewRequestByName
Reviewer: ReviewerName
[Review Now](link)
🔄 Changes Requested
Repo: RepoName
PR: PR# - PR Title
Reviewer: ReviewerName
[Read Review](link)
✅ PR Approved
Repo: RepoName
PR: PR# - PR Title
Reviewer: ReviewerName
[Read Review](link)

Job Status Preset

Use this to report whether a build, test, or deploy succeeded or failed. This can be customized by changing if conditions to the notify job.

# ... rest of workflowjobs:
build:
runs-on: ubuntu-lateststeps:
- run: exit 1 # Simulating a failurenotify:
needs: [build]if: always()uses: acep-devops/workflows/.github/workflows/mattermost-notify.yml@mainwith:
preset: "status"job_status: ${{ needs.build.result }}title: "Docker Build"secrets:
MM_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}

Example Outputs

❌ CI on Push to Main Failed
Repo: RepoName
Ref: PR#/merge
Author: AuthorName
[View Logs](link)
✅ Docker Deploy on Branch(main) Succeeded
Repo: RepoName
Ref: PR#/merge
Author: AuthorName
[View Logs](link)

Custom Preset

TO DO

About

A centralized collection of reusable GitHub Actions workflows and automation templates for ACEP.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors