Workflows to help manage Dependabot PRs in GitHub repositories.
This workflow can be called to combine multiple open Dependabot PRs into a single PR.
- branchPrefix: Branch prefix to find combinable PRs based on. Default:- dependabot
- mustBeGreen: Only combine PRs that are green (status is success). Default:- true
- combineBranchName: Name of the branch to combine PRs into. Default:- combine-dependabot-PRs
- ignoreLabel: Exclude PRs with this label. Default:- nocombine
name: Combine Dependabot PRs
on:
  workflow_dispatch:
    inputs:
      branchPrefix:
        description: "Branch prefix to find combinable PRs based on"
        required: true
        type: string
      mustBeGreen:
        description: "Only combine PRs that are green (status is success)"
        required: true
        type: boolean
      combineBranchName:
        description: "Name of the branch to combine PRs into"
        required: true
        type: string
      ignoreLabel:
        description: "Exclude PRs with this label"
        required: true
        type: string
jobs:
  combine-dependabot-prs:
    uses: NHSDigital/eps-workflow-dependabot/.github/workflows/[email protected]
    with:
      branchPrefix: ${{ github.event.inputs.branchPrefix }}
      mustBeGreen: ${{ github.event.inputs.mustBeGreen }}
      combineBranchName: ${{ github.event.inputs.combineBranchName }}
      ignoreLabel: ${{ github.event.inputs.ignoreLabel }}
This workflow can be called to automatically approve and merge Dependabot PRs as part of the pull request workflow.
Ensure that the AUTOMERGE_APP_ID and AUTOMERGE_PEM secrets are set, a requires-manual-qa PR label is created, and the repo is added to the eps-autoapprove-dependabot GitHub App.
name: Pull Request
on:
  pull_request:
    branches: [main]
jobs:
  dependabot-auto-approve-and-merge:
    uses: NHSDigital/eps-workflow-dependabot/.github/workflows/[email protected]
    secrets:
      AUTOMERGE_APP_ID: ${{ secrets.AUTOMERGE_APP_ID }}
      AUTOMERGE_PEM: ${{ secrets.AUTOMERGE_PEM }}