Skip to content

Gardener: require manual label, keep Dependabot auto-label#7362

Merged
byrichardpowell merged 1 commit intomainfrom
rp-gardener-manual-label
Apr 21, 2026
Merged

Gardener: require manual label, keep Dependabot auto-label#7362
byrichardpowell merged 1 commit intomainfrom
rp-gardener-manual-label

Conversation

@byrichardpowell
Copy link
Copy Markdown
Contributor

@byrichardpowell byrichardpowell commented Apr 21, 2026

Summary

Changes the gardener Slack notifier so that the devtools-gardener label (which gates Slack posting) must be applied manually for human-opened issues and PRs. Dependabot-opened PRs are still auto-labeled.

Why

The previous flow applied devtools-gardener to every newly opened issue and PR. This repo gets a lot of PR's, many of which don't need to be reviewed by this team. So it was too noisy.

Dependabot PRs are kept auto-labeled because we always want dependency updates to surface for triage, and there's no human to apply the label.

Behavior matrix

Event Before After
Human opens issue/PR Label applied, Slack post Nothing
Human applies devtools-gardener Slack post Slack post
Dependabot opens PR Label applied, Slack post Label applied, Slack post

How it works

gardener-notify-event.yml (capture):

  • Dropped opened from issues: types — issues now only capture on labeled.
  • Kept opened on pull_request_target: but the job if only admits it when the opener is dependabot[bot].
  • labeled events still pass through when the label is devtools-gardener.

gardener-notify-slack.yml (downstream workflow_run):

  • The auto-label step is scoped to the Dependabot-opened path (action == opened && login == dependabot[bot]) instead of every opened event.
  • No duplicate Slack posts: labels applied here via GITHUB_TOKEN don't trigger another labeled run (GitHub's loop-prevention).

The two-workflow pattern is still needed: Dependabot-triggered workflows have read-only GITHUB_TOKEN and no Actions secret access, so labeling and Slack posting happen in the workflow_run follow-up which runs in the default-branch context.

The `devtools-gardener` label was applied to every new issue and PR,
which posted to Slack on every open — too noisy. Humans now opt in by
applying the label manually. Dependabot PRs are still auto-labeled so
they continue to surface in the gardener flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 21, 2026 20:07
@byrichardpowell byrichardpowell requested a review from a team as a code owner April 21, 2026 20:07
@github-actions github-actions Bot added the devtools-gardener Post the issue or PR to Slack for the gardener label Apr 21, 2026
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

Updates the Gardener Slack notification workflows so that Slack posting is gated by a manually applied devtools-gardener label for human-created issues/PRs, while keeping Dependabot PRs automatically labeled (and posted) to ensure dependency updates remain visible.

Changes:

  • Stop capturing issues: opened events so human-opened issues no longer auto-post to Slack.
  • Gate pull_request_target: opened capture to Dependabot PRs only; keep labeled capture for manual devtools-gardener.
  • Scope downstream auto-labeling to only Dependabot-opened PRs in the workflow_run workflow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/gardener-notify-event.yml Adjusts event capture triggers/conditions to only pass through manual devtools-gardener labels and Dependabot-opened PRs.
.github/workflows/gardener-notify-slack.yml Limits auto-labeling to Dependabot-opened PRs while continuing to post Slack summaries for captured events.

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

@byrichardpowell byrichardpowell added this pull request to the merge queue Apr 21, 2026
Merged via the queue into main with commit 68c1d22 Apr 21, 2026
31 checks passed
@byrichardpowell byrichardpowell deleted the rp-gardener-manual-label branch April 21, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devtools-gardener Post the issue or PR to Slack for the gardener

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants