Skip to content

fix: populate Slack notification fields on workflow_dispatch#253

Merged
cweinberger merged 1 commit intomainfrom
fix/workflow-dispatch-slack-null-fields
Mar 4, 2026
Merged

fix: populate Slack notification fields on workflow_dispatch#253
cweinberger merged 1 commit intomainfrom
fix/workflow-dispatch-slack-null-fields

Conversation

@cweinberger
Copy link
Member

Summary

  • Fix null Committer, Message, and Change fields in Slack deployment notifications when triggered via workflow_dispatch (manual trigger)
  • Adds a step in component-initialize.yml that fetches HEAD commit info via the GitHub API and writes a push-compatible event file before the slack-notifier-cli runs

Root cause

The slack-notifier-cli binary parses $GITHUB_EVENT_PATH trying push → opened → created event structures. On workflow_dispatch, the event payload has none of these, so all fields fall through to null.

How it works

  1. New step runs only on workflow_dispatch events (if: github.event_name == 'workflow_dispatch')
  2. Fetches the HEAD commit (${{ github.sha }}) info via gh api
  3. Writes a push-compatible JSON structure (with head_commit and pusher) to $GITHUB_EVENT_PATH
  4. The slack-notifier-cli then parses this enriched event and populates Committer, Message, and Change correctly

Test plan

  • Trigger a manual workflow_dispatch deployment on any service → verify Slack notification shows Committer, Message, and Change
  • Verify tag-push deployments still work (this step is skipped via if condition)
  • Verify PR-triggered workflows still work

🤖 Generated with Claude Code

When deployments are triggered via workflow_dispatch (manual trigger),
the GitHub event payload lacks head_commit and pusher data, causing
Committer, Message, and Change to show as null in Slack notifications.

This adds a step that fetches the HEAD commit info via the GitHub API
and writes a push-compatible event file before the notifier runs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cweinberger cweinberger merged commit 70e1ed5 into main Mar 4, 2026
1 check passed
@cweinberger cweinberger deleted the fix/workflow-dispatch-slack-null-fields branch March 4, 2026 13:49
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