Skip to content

feat: action to send a message to a mattermost channel#6

Merged
mattyg merged 1 commit into
mainfrom
feat/mattermost-notify-action
Mar 27, 2026
Merged

feat: action to send a message to a mattermost channel#6
mattyg merged 1 commit into
mainfrom
feat/mattermost-notify-action

Conversation

@mattyg

@mattyg mattyg commented Mar 27, 2026

Copy link
Copy Markdown
Member

An action to send a message to a mattermost channel. This will be used in wind-tunnel to alert the team if the step to cancel threefold contracts fails (see holochain/wind-tunnel#576 (comment))

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@mattyg has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 41 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 12 minutes and 41 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d028fbe0-fb1b-4a2d-b913-21da3578ed92

📥 Commits

Reviewing files that changed from the base of the PR and between 6b7ece5 and c6743cb.

📒 Files selected for processing (2)
  • .github/workflows/mattermost-notify.yml
  • README.md

Walkthrough

A new GitHub Actions reusable workflow for Mattermost notifications was added, along with documentation. The workflow accepts inputs for Mattermost URL, channel ID, and message content, authenticates using a personal access token, and sends the notification via the Mattermost API.

Changes

Cohort / File(s) Summary
New Mattermost notification workflow
.github/workflows/mattermost-notify.yml
Introduced reusable workflow that sends messages to Mattermost. Accepts inputs for mattermost_url (with default), channel_id, and message, plus optional MATTERMOST_PERSONAL_ACCESS_TOKEN secret. Uses curl and jq to POST to Mattermost API with error handling for non-2xx responses.
Workflow documentation
README.md
Added documentation describing the Mattermost notifier action, including workflow path, input parameters, required secret, and example usage snippet for calling the reusable workflow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding a new GitHub Actions workflow to send messages to Mattermost channels.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mattermost-notify-action

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/mattermost-notify.yml (1)

45-61: Consider cleaning up the temporary file.

The temporary file created for the response body is never explicitly cleaned up. While this isn't critical since GitHub Actions runners are ephemeral, adding cleanup ensures proper resource management.

♻️ Proposed enhancement to add temp file cleanup
           '{channel_id: $channel_id, message: $message}')"

           response_body="$(mktemp)"
+          trap 'rm -f "$response_body"' EXIT

           response_code="$(curl \
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/mattermost-notify.yml around lines 45 - 61, The temporary
file created in the curl block (response_body="$(mktemp)") isn't removed; add
cleanup by removing the temp file after use and on errors: either add a trap
like trap 'rm -f "$response_body"' EXIT near where response_body is created, or
ensure rm -f "$response_body" is called both after the success path and before
any exit in the error path (the curl/post handling block referencing
response_body and response_code).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/mattermost-notify.yml:
- Around line 20-22: The MATTERMOST_PERSONAL_ACCESS_TOKEN secret is declared as
required: false but is used unconditionally (sent in the Authorization header),
so either mark MATTERMOST_PERSONAL_ACCESS_TOKEN as required: true in the
workflow inputs or add conditional logic before the API call that checks the
input (MATTERMOST_PERSONAL_ACCESS_TOKEN) and skips or aborts the notification
step if it's empty; update the step that constructs the Authorization header
(where Authorization: Bearer is set) to only set/send the header when the token
value exists (or fail early with a clear error message).

---

Nitpick comments:
In @.github/workflows/mattermost-notify.yml:
- Around line 45-61: The temporary file created in the curl block
(response_body="$(mktemp)") isn't removed; add cleanup by removing the temp file
after use and on errors: either add a trap like trap 'rm -f "$response_body"'
EXIT near where response_body is created, or ensure rm -f "$response_body" is
called both after the success path and before any exit in the error path (the
curl/post handling block referencing response_body and response_code).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e3191bbb-06ec-4473-af61-762aee790f40

📥 Commits

Reviewing files that changed from the base of the PR and between ae50ddb and 6b7ece5.

📒 Files selected for processing (2)
  • .github/workflows/mattermost-notify.yml
  • README.md

Comment thread .github/workflows/mattermost-notify.yml Outdated
@mattyg mattyg force-pushed the feat/mattermost-notify-action branch from 6b7ece5 to d10e6b0 Compare March 27, 2026 01:15
@mattyg mattyg force-pushed the feat/mattermost-notify-action branch from d10e6b0 to c6743cb Compare March 27, 2026 01:16
@cocogitto-bot

cocogitto-bot Bot commented Mar 27, 2026

Copy link
Copy Markdown

✔️ c6743cb - Conventional commits check succeeded.

@mattyg mattyg requested a review from a team March 27, 2026 01:17
@mattyg mattyg merged commit c070e4d into main Mar 27, 2026
4 checks passed
@mattyg mattyg deleted the feat/mattermost-notify-action branch March 27, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants