Add Dependabot gate to auto-close dependency bumps ahead of Home Assistant#263
Merged
Merged
Conversation
Copilot created this pull request from a session on behalf of
timlaing
May 26, 2026 21:15
View session
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow to automatically close Dependabot dependency-bump PRs when the proposed dependency version is newer than the version pinned by Home Assistant, reducing upgrade churn and keeping this project aligned with HA’s dependency constraints.
Changes:
- Introduces a
pull_request_targetworkflow that runs only for Dependabot PRs. - Parses Dependabot PR titles to extract dependency name and target version, then fetches HA’s
requirements_all.txtto compare pinned versions. - If HA’s pinned version is older than the Dependabot target, comments with the reason and closes the PR.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| jobs: | ||
| close_pr_if_ha_uses_older_version: | ||
| if: github.actor == 'dependabot[bot]' |
Comment on lines
+50
to
+52
| run: | | ||
| python -m pip install --disable-pip-version-check packaging | ||
| python - <<'PY' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dependabot PRs can propose dependency versions newer than what Home Assistant currently pins, creating churn and incompatible update noise. This change adds an automated gate to close those PRs when the proposed version is ahead of HA’s current requirement.
Workflow entrypoint and safety scope
.github/workflows/close_dependabot_pr_if_ha_older.yml.pull_request_targetevents and only executes fordependabot[bot].Version extraction and comparison logic
Bump <dep> from <old> to <new>) using robust delimiter logic.home-assistant/coredev/requirements_all.txt.-,_,.) before matching and compares versions viapackaging.version.Version.Automated PR action