Repository navigation
Fix Dependabot auto-merge by exempting dependency manifests from code owner review - #7019
Closed
amartinezfayo wants to merge 2 commits into
Closed
amartinezfayo wants to merge 2 commits into
amartinezfayo wants to merge 2 commits into
Conversation
… owner review Signed-off-by: Agustín Martínez Fayó <[email protected]>
amartinezfayo
requested review from
MarcosDY,
evan2645,
rturner3 and
sorindumitru
as code owners
June 3, 2026 13:19
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts repository automation so Dependabot go.mod/go.sum patch/minor updates can be merged via the merge queue after CI passes, without enabling GitHub’s repository auto-merge feature and without changing review requirements for other file types.
Changes:
- Exempts
/go.modand/go.sumfrom CODEOWNERS review requirements to unblock merge-queue merges driven by the workflow. - Adds CI enforcement to reject
replace/excludedirectives ingo.modto mitigate supply-chain redirection risk. - Updates the Dependabot auto-merge workflow to only approve/merge PRs that touch only
go.mod/go.sum, and adds brief merge retries. - Adds a 7-day cooldown to Dependabot updates for both
gomodandgithub-actionsecosystems.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
CODEOWNERS |
Exempts go.mod/go.sum from code owner review so automation can satisfy branch protections. |
.github/workflows/pr_build.yaml |
Adds a lint-time check preventing replace/exclude directives in go.mod. |
.github/workflows/dependabot_automerge.yml |
Detects manifest-only PRs, skips others, and retries merge-queue enrollment. |
.github/dependabot.yml |
Adds Dependabot cooldown configuration for both update ecosystems. |
Signed-off-by: Agustín Martínez Fayó <[email protected]>
Member
Author
|
Closing in favor of #7070, which takes a different direction. We have decided to step back from automated Dependabot merges and switch to grouped weekly Dependabot PRs that maintainers review and merge by hand. |
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.
The Dependabot auto-merge workflow has never successfully merged a PR. After CI passes, the workflow assigns the milestone and approves, but the merge step fails with
GraphQL: Auto merge is not allowed for this repository (enablePullRequestAutoMerge). An example of a failure is here: https://github.com/spiffe/spire/actions/runs/26658532935The root cause is that
go.modandgo.sumfall under the*rule inCODEOWNERS, so the "require review from code owners" branch protection requirement is never satisfied by the workflow'sgithub-actions[bot]approval. Because the PR can never become merge-ready,gh pr mergefalls back to enabling auto-merge, which is a feature that is intentionally disabled on this repository.This PR exempts
/go.modand/go.sumfrom code owner review using the documented CODEOWNERS pattern of leaving the owners empty. With that, a verified Dependabot PR meets all branch protection requirements as soon as the workflow approves it, andgh pr mergeadds it directly to the merge queue, the same as clicking "Merge when ready". The "Allow auto-merge" repository setting remains disabled and the review process for every other PR is unchanged. The merge step now also retries briefly, since GitHub recomputes the mergeability state asynchronously after the approval is submitted.The workflow now only approves and merges PRs whose changed files are limited to
go.modandgo.sum. For other Dependabot PRs, such asgithub-actionsecosystem updates that modify workflow files, it assigns the milestone and leaves review and merge to the maintainers instead of failing at the merge step.Security considerations:
dependabot[bot]and contain exactly one commit cryptographically signed by Dependabot. A regular PR touching onlygo.modandgo.sumstill requires an approving review from a collaborator with write access, and only a collaborator can add it to the merge queue. A PR touchinggo.modtogether with any other file still requires code owner review, since ownership applies per file.Module directive checkstep in the lint job rejectsreplaceandexcludedirectives ingo.mod, so ago.mod-only PR cannot redirect a module to a different source repository. This closes the one meaningful capability that removing the code owner requirement would otherwise add.cooldownlets new upstream releases age before an update PR is opened, preserving a window for the ecosystem to detect and report a compromised release before it can land unattended. This mitigates the main residual supply chain exposure (a malicious version published upstream), which exists today as well, since routine version bumps are typically merged within a day or two of being opened. The cooldown applies to both thegomodandgithub-actionsecosystems.