Skip to content

Add reusable dependabot-auto-merge workflow that merges only the commit that passed checks #3

Description

@dwisiswant0

Add a reusable workflow that runs the compatibility checks on Dependabot PRs and merges only the commit that passed them.

13 public repos send Dependabot PRs through a compatibility-check workflow, and 12 of them start a separate auto-merge workflow when it completes. The copies use three different gates and behave differently:

  • The auto-merge workflows in httpx, katana, pdtm, and wappalyzergo fail or skip, so maintainers merge those PRs by hand. Only the 8 repos with the plain conclusion == 'success' gate merge automatically.
  • The merge acts on the PR's current head, not on the commit that passed the checks (pr/merge).
  • chore(deps): bump the modules group with 9 updates dnsx#1102 merged at 02:44:24 UTC, while its functional tests ran until 02:45:26 UTC.

The other half of this flow lives in the build-test workflows, which skip every job for bot PRs: lint skips bots, and the other jobs need it (example). depx, gozero, pd-agent, and utils have no compatibility check, so their Dependabot PRs merge with no build or test run (projectdiscovery/utils#851, projectdiscovery/depx#30, projectdiscovery/pd-agent#181, projectdiscovery/gozero#50).

With the workflow, a repo gets both paths in one place: Dependabot PRs go through the compatibility checks and merge at the tested commit, and other PRs go through the full build.

Before this lands:

  • pr/merge in projectdiscovery/actions needs an option to merge only a given commit. I'll file that separately.
  • A fork PR needs testing, because the auto-merge job doesn't check where the PR came from.
  • This repo must be public: public repos can only call reusable workflows from public repos (docs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: Enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions