Skip to content

Fix dependabot auto-merge workflow: branch protection + Node 20 deprecation - #152

Merged
DavidIQ merged 2 commits into
dependabot/nuget/JWLMerge.BackupFileServices/Microsoft.Data.Sqlite-10.0.10from
copilot/fix-dependabot-failing-job
Jul 28, 2026
Merged

Fix dependabot auto-merge workflow: branch protection + Node 20 deprecation#152
DavidIQ merged 2 commits into
dependabot/nuget/JWLMerge.BackupFileServices/Microsoft.Data.Sqlite-10.0.10from
copilot/fix-dependabot-failing-job

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

gh pr merge --rebase was failing immediately when branch protection rules required status checks to pass. Additionally, dependabot/fetch-metadata@v2.3.0 was triggering Node.js 20 deprecation warnings on current runners.

Changes

  • dependabot/fetch-metadata v2.3.0 → v3.1.0 — natively targets Node.js 24, eliminating the deprecation warning
  • --auto flag on gh pr merge — queues the merge until branch protection requirements are satisfied instead of failing outright
  • || true — prevents workflow failure when auto-merge is not enabled at the repository level

Copilot AI changed the title Fix dependabot auto-merge workflow Fix dependabot auto-merge workflow: branch protection + Node 20 deprecation Jul 27, 2026
Copilot AI requested a review from DavidIQ July 27, 2026 23:50
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Merge Dependabot PRs
run: gh pr merge --rebase "$PR_URL"
run: gh pr merge --auto --rebase "$PR_URL" || true

@DavidIQ DavidIQ Jul 27, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot Are you sure about this? Will this merge the pr if the first command fails?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question. The || true does not merge the PR if the --auto command fails — it only prevents the workflow from reporting a failure exit code.

The design here is:

  • --auto is needed because branch protection rules block an immediate merge; --auto queues the merge to happen once all checks pass
  • If the repository doesn't have auto-merge enabled at the settings level, gh pr merge --auto will fail with an error — || true makes that a silent no-op rather than a red workflow run

If the first command fails (e.g. auto-merge not enabled), the PR simply won't be merged automatically, but the workflow won't show as broken. If you'd rather have the workflow fail loudly in that case, I can remove the || true.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot what about trying a direct merge as well as the auto merge?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in bf25cbe. The command is now gh pr merge --auto --rebase "$PR_URL" || gh pr merge --rebase "$PR_URL" — it tries auto-merge first, and falls back to a direct merge if auto-merge isn't available.

@DavidIQ
DavidIQ marked this pull request as ready for review July 28, 2026 00:04
@DavidIQ
DavidIQ merged commit f664713 into dependabot/nuget/JWLMerge.BackupFileServices/Microsoft.Data.Sqlite-10.0.10 Jul 28, 2026
3 checks passed
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.

2 participants