Skip to content

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

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
    • Slack notifications now run only for merged pull requests from the same repository when a channel is configured. Merges from forked repositories no longer trigger notifications.

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
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Slack notification workflow now listens for pull_request events. The notification job runs only for merged pull requests from the same repository when SLACK_CHANNEL_ID is nonempty.

Changes: Slack merge notifications

Layer / File(s) Summary
Trigger and job conditions
.github/workflows/notify-slack-on-main-merge.yml
The workflow listens for closed pull requests targeting main. The job requires that the pull request was merged, its head repository matches the workflow repository, and SLACK_CHANNEL_ID is nonempty.

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

Change: Other

Possibly related PRs

  • plainlang/plain-forge#34: This PR created the workflow and configured merge notifications with pull_request_target; this change replaces that event with pull_request.

Suggested reviewers: hisenb3rg

Merge Risk: Minimal · up to a84ff

Same-repository merges remain eligible for Slack notices; fork merges are intentionally skipped. No merge-blocking issue was established.

Architecture risk: Low · up to a84ff

The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency.

Changed systems: None identified.

Architecture concerns
No architecture-level concerns identified.

Review details

Before / after behavior

  • observed — Modified behavior in .github/workflows/notify-slack-on-main-merge.yml: The workflow trigger changes from pull_request_target to pull_request; it still listens for closed PRs targeting main. The accompanying comments now state that fork PRs receive no secrets and do not post notifications.
  • observed — Modified behavior in .github/workflows/notify-slack-on-main-merge.yml: The job condition adds a same-repository check on the PR head, alongside the existing merged-PR and nonempty-channel checks. Fork PR merges that previously could satisfy the condition are now excluded.
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 change: moving post-merge notices from pull_request_target to pull_request.
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
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: b56af08f-6188-4ff1-a134-4d404d2407ba
Commits

Reviewing files that changed from the base of the PR and between 95198d4 and a84ff52.

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 10 included reviews per hour; 9 remain after this review.

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

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