Skip to content

feat(ci): auto-assign the PR author as assignee on open#60929

Merged
webjunkie merged 4 commits into
masterfrom
claude/auto-assign-pr-author
Jun 1, 2026
Merged

feat(ci): auto-assign the PR author as assignee on open#60929
webjunkie merged 4 commits into
masterfrom
claude/auto-assign-pr-author

Conversation

@webjunkie
Copy link
Copy Markdown
Contributor

Problem

PostHog has never been diligent about the GitHub Assignees field on PRs. Reviewers are already handled well (CODEOWNERS-based auto-assignment), but "who owns / is the DRI for this PR" is left blank — so assignee:@me filters, project boards, and "what's on my plate" views are unreliable, and there's no single owner to poke when a PR stalls or gets handed off.

Changes

Auto-assign the PR author as the assignee when a PR is opened. The author is the natural DRI, and assignment is the lowest-cost win here — no round-robin "assign a random staffer" logic, which tends to become notification noise.

This is DRY'd into the existing on-open author job in pr-opened.yml (the one that already nudges non-@posthog.com git emails), renamed to author-hygiene since it now covers two author-on-open concerns. The new step:

  • runs only on the initial opened action (fires exactly once; drafts included),
  • skips forks (external authors aren't assignable) and bot-authored PRs,
  • is continue-on-error, so it can never turn a PR red.

Deliberately not included: assigning other/random staff as assignees (diffusion of responsibility + notification fatigue) — that's left to the existing reviewer automation.

How did you test this code?

I'm an agent. There's no automated test harness for this workflow's inline script. I validated pr-opened.yml with actionlint (passes), confirmed it's oxfmt-clean, and checked the YAML parses. The added step uses the standard github.rest.issues.addAssignees call under the workflow's existing pull-requests: write permission (same permission that already backs PR comments in this file).

🤖 Agent context

Authored by Claude Code (Opus) at @webjunkie's request, as a follow-up to the author-email-nudge work (#60613, #60693).

Decision trail:

  • Discussed assignees vs reviewers. Reviewers are already covered by auto-assign-reviewers.yml; the gap was the assignee/DRI field.
  • Chose author-as-assignee only. Rejected round-robin/shepherd assignment of other staff — it looks diligent but degrades into ignored notifications and diffuses ownership; the right number of assignees for accountability is one.
  • DRY'd into the existing opened-triggered author job rather than adding a new workflow file, since it already deals with the PR author on open. Kept the assignee step independent of the org-membership/app-token logic (assignment needs neither).
  • Gated on non-fork + non-bot, and made it non-blocking, consistent with the sibling nudge step's "never fail the PR" stance.

Generated by Claude Code

Copilot AI review requested due to automatic review settings June 1, 2026 14:37
@assign-reviewers-posthog assign-reviewers-posthog Bot requested a review from a team June 1, 2026 14:37
Copy link
Copy Markdown
Member

@rnegron rnegron left a comment

Choose a reason for hiding this comment

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

I'm surprised there is no GH setting to auto-enable this 😬

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the “Opened PR” GitHub Actions workflow to automatically assign the PR author as the assignee when the PR is first opened, and consolidates that with the existing “author email hygiene” nudge into a single job.

Changes:

  • Renamed/repurposed the existing check-author-email job into author-hygiene.
  • Added a non-blocking step to assign the PR author to their own PR on the initial opened event (skipping forks and bots).
  • Kept the existing org-membership + commit-email nudge behavior under the renamed job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/pr-opened.yml Outdated
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 1, 2026

Reviews (1): Last reviewed commit: "fix(ci): exclude bot accounts from autho..." | Re-trigger Greptile

@webjunkie webjunkie enabled auto-merge (squash) June 1, 2026 14:43
@webjunkie webjunkie merged commit f33bca3 into master Jun 1, 2026
144 checks passed
@webjunkie webjunkie deleted the claude/auto-assign-pr-author branch June 1, 2026 14:52
@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented Jun 1, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-06-01 15:14 UTC Run
prod-us ✅ Deployed 2026-06-01 15:45 UTC Run
prod-eu ✅ Deployed 2026-06-01 15:44 UTC Run

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.

4 participants