Add dependabot automation workflows#68
Conversation
|
@PaulLaux What do you think? |
I would say it depends on the context, if we see it as dependabot automation couldn't update dependencies without breaking our tests, it makes sense. We will have the PR/notifications as an alert that manual intervention is required. |
Review Summary by QodoAdd auto-merge workflow for Dependabot pull requests
WalkthroughsDescription• Add GitHub Actions workflow for auto-merging Dependabot PRs • Automatically approve and merge non-major version updates • Uses Dependabot metadata to filter update types • Enables squash merge strategy for clean commit history Diagramflowchart LR
A["Dependabot PR Created"] -- "Fetch metadata" --> B["Check Update Type"]
B -- "Not semver-major" --> C["Approve PR"]
C -- "Enable auto-merge" --> D["PR Auto-Merged"]
B -- "Is semver-major" --> E["Skip Auto-Merge"]
File Changes1. .github/workflows/dependabot-auto-merge.yml
|
Code Review by Qodo
1.
|
PaulLaux
left a comment
There was a problem hiding this comment.
Let's go with
name: Auto-merge Dependabot PRs
on: pull_request_target
permissions:
contents: write
pull-requests: write
jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge for patch and minor updates
if: |
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}However, for this to work properly, we need to force Status checks that are required on the main branch. If not properly set, this will merge everything without any testing.
Currently, the only check that is set is rust fmt, while we need all the CI checks to be performed. I don't see a way to add all the CI checks; the list is empty.
Please update the YAML and add the CI checks before re-review.
https://github.com/QED-it/zcash_tx_tool/settings/branch_protection_rules/46841401

Updated the rules and code. |

Add an automation to close dependabot PRs that fail the tests, and one to merge PRs that pass them