Skip to content

ci: post merge notices on pull_request, not pull_request_target - #358

Open
gorandodig wants to merge 1 commit into
mainfrom
ci/slack-merge-on-pull-request
Open

gorandodig wants to merge 1 commit into
mainfrom
ci/slack-merge-on-pull-request

Conversation

@gorandodig

@gorandodig gorandodig commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

GitHub will block pull_request_target in public repos by default from 2 December 2026, unless an Actions event policy allows it. This merge notifier would then stop posting, so it moves to pull_request (closed).

  • Merged PRs from forks get no secrets under pull_request, so the job now skips them instead of failing. Merges from branches in this repo post as before.
  • Under pull_request, the workflow file comes from the PR's merge ref rather than main. Only branches in this repo reach the step that uses the token.

Summary by CodeRabbit

  • Chores
    • Merge notifications are now limited to pull requests merged from this repository and are sent only when a Slack channel is configured. Merged pull requests from forked repositories no longer trigger notifications. The notification message format remains unchanged. These adjustments affect internal merge notifications and do not change the experience of using the product.

GitHub blocks pull_request_target in public repos by default from
2 Dec 2026. Fork PRs get no secrets under pull_request, so their merges
are skipped instead of failing.
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Slack notification workflow now listens to pull_request. It sends a notification only when the pull request is merged, comes from the current repository, and SLACK_CHANNEL_ID is nonempty.

Changes: Slack merge notifications

Layer / File(s) Summary
Trigger and notification conditions
.github/workflows/notify-slack-on-main-merge.yml
The workflow uses pull_request and checks that the merged pull request comes from the current repository and that SLACK_CHANNEL_ID is nonempty.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related PRs

Suggested labels: github-actions

Suggested reviewers: zanjonke

Merge Risk: Minimal · up to 60e85

No actionable merge-blocking risk was identified in this workflow change.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main workflow change from pull_request_target to pull_request for post-merge notices.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 81363d86-95a5-4dbb-83a7-6caa9556cbb7
Commits

Reviewing files that changed from the base of the PR and between 8eed15a and 60e85ee.

Files selected for processing: 1
  • .github/workflows/notify-slack-on-main-merge.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@gorandodig
gorandodig marked this pull request as ready for review November 4, 2026 15:15

This branch has not been deployed

No deployments
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.

1 participant