A centralized collection of reusable GitHub Actions workflows and automation templates for ACEP.
This reusable workflow standardizes Mattermost alerts across different repositories. It supports presets for common events like Pull Request reviews and Job Status updates.
To use this workflow, create a job in your caller workflow (e.g., .github/workflows/deploy.yml).
| Input | Description | Required | Default |
|---|---|---|---|
preset |
Type of message: status, review_request, review_decision, or custom. |
No | custom |
job_status |
The result of the previous job (success, failure). Required for status. |
No | N/A |
title |
Overrides the prefix in status messages (e.g., "Production Deploy"). | No | Action |
message |
Appends a custom string or note to the bottom of any preset. | No | "" |
| Secret | Description | Required |
|---|---|---|
MM_WEBHOOK_URL |
The incoming webhook URL from your Mattermost channel, set this as a repository secret. | Yes |
Use this combined workflow to handle both new review requests and submitted review decisions (Approvals/Changes Requested).
name: PR Notifications
on:
pull_request:
types: [review_requested]
pull_request_review:
types: [submitted]
jobs:
# Triggered when a reviewer is specifically requested
notify-on-request:
if: github.event.action == 'review_requested'
uses: acep-devops/workflows/.github/workflows/mattermost-notify.yml@main
with:
preset: "review_request"
secrets:
MM_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}
# Triggered when a reviewer submits an Approval or Changes Requested
notify-on-submit:
if: github.event.action == 'submitted'
uses: acep-devops/workflows/.github/workflows/mattermost-notify.yml@main
with:
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)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 workflow
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: exit 1 # Simulating a failure
notify:
needs: [build]
if: always()
uses: acep-devops/workflows/.github/workflows/mattermost-notify.yml@main
with:
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)TO DO