Skip to content

Move dependabot-auto-merge off pull_request_target - #3110

Open
Jesse Hills (jesserockz) wants to merge 4 commits into
mainfrom
jesserockz-2026-1027
Open

Jesse Hills (jesserockz) wants to merge 4 commits into
mainfrom
jesserockz-2026-1027

Conversation

@jesserockz

@jesserockz Jesse Hills (jesserockz) commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

What does this implement/fix?

Moves dependabot-auto-merge.yml from pull_request_target to plain pull_request, ahead of GitHub blocking pull_request_target by default in public repos from 2026-12-02.

On pull_request the workflow is loaded from the PR merge commit, so it no longer runs any action a bump could propose:

  • dependabot/fetch-metadata is replaced by script/dependabot_update_type.py, a stdlib script fetched from the default branch.
  • The read-only classify job runs it over gh pr diff and reports major, minor, patch or unknown.
  • The auto-merge job holds the write grants, runs only gh pr merge --auto --squash, and only for minor or patch.
  • Workflow-level permissions is {}.

Other notes:

  • Dependabot pull_request runs get a read-only GITHUB_TOKEN unless permissions: raises it, so the job-level grants keep auto-merge working. No other secrets are used.
  • The guard also checks github.actor == 'dependabot[bot]', so a run triggered by a human pushing to a Dependabot branch is skipped.
  • Dependabot targets main (no target-branch in dependabot.yml), so the workflow file comes from main once this merges.

Related issue or feature (if applicable):

Types of changes

  • Bugfix (non-breaking change which fixes an issue) — bugfix
  • New feature (non-breaking change which adds functionality) — new-feature
  • Enhancement to an existing feature — enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — breaking-change
  • Refactor (no behaviour change) — refactor
  • Documentation only — docs
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Frontend coordination

  • No frontend change needed
  • Companion frontend PR: esphome/device-builder-frontend#

Checklist

  • The code change is tested and works locally.
  • Pre-commit hooks pass (ruff, codespell, yaml/json/python checks).
  • Tests have been added or updated under tests/ where applicable.
  • components.index.json / definitions/components/*.json have not been hand-edited (regenerate via script/sync_components.py if a sync is needed).
  • Architecture-level changes are reflected in docs/ARCHITECTURE.md and/or docs/API.md.

Dependabot runs on pull_request respect the workflow's permissions block, so auto-merge keeps working without the privileged trigger.
Copilot AI adaptive review requested due to automatic review settings November 26, 2026 08:24
@jesserockz Jesse Hills (jesserockz) added the ci Continuous integration / build / release tooling label Nov 26, 2026
@codspeed

codspeed Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 28 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing jesserockz-2026-1027 (9cb5f3f) with main (8c74e3d)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩

@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (50fc28c) to head (9cb5f3f).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #3110      +/-   ##
===========================================
+ Coverage   99.77%   100.00%   +0.22%     
===========================================
  Files         305       305              
  Lines       27006     27006              
===========================================
+ Hits        26945     27006      +61     
+ Misses         61         0      -61     
Flag Coverage Δ
py3.12 99.96% <ø> (+0.22%) ⬆️
py3.14 99.85% <ø> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 24 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The workflow executes PR-proposed action code with a write-capable token before review or required checks, allowing a compromised release to modify repository contents or PRs.

1 open issue
What changed in this PR

Moves the repository’s Dependabot auto-merge workflow from pull_request_target to pull_request, ahead of the GitHub restriction described in #3083.

Changes:

  • Switches the workflow trigger to pull_request.
  • Requires the triggering actor to be dependabot[bot], alongside existing PR-author and repository checks.
  • Adds comments explaining the retained write permissions.
File Description
.github/​workflows/​dependabot-auto-merge.yml Changes the trigger, tightens the job guard, and documents token permissions.

Review effort: Max (adaptive)

The metadata job runs the PR-proposed fetch-metadata action with a read-only token; the write-scoped job runs only gh pr merge.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The auto-merge workflow trusts metadata from the proposed dependabot/fetch-metadata version, allowing a compromised or broken major update to classify itself as a patch and bypass the major-update gate.

1 open issue
1 resolved since last review

Review effort: Max (adaptive)

The proposed fetch-metadata version would otherwise classify its own update.
Replaces dependabot/fetch-metadata with a stdlib script fetched from the default branch, so the workflow runs no action a bump could propose.

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

ci Continuous integration / build / release tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move dependabot-auto-merge.yml off pull_request_target

2 participants