Skip to content

Automerging workflow #257

@erichartline

Description

@erichartline

I made some changes to the automerging workflow for repositories that rely on unit tests.

name: Automerge (Dependabot)
on: [pull_request]
jobs:
  automerge:
    runs-on: ubuntu-20.04
    if: github.actor == 'dependabot[bot]'
    steps:
      - name: wait for unit tests to pass
        uses: fountainhead/action-wait-for-check@v1.0.0
        id: wait-for-unit-tests
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          checkName: Unit tests
          ref: ${{ github.event.pull_request.head.sha || github.sha }}
      - name: merge
        if: steps.wait-for-unit-tests.outputs.conclusion == 'success'
        uses: ridedott/merge-me-action@v1.8.47
        with:
          GITHUB_LOGIN: dependabot[bot]
          GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
          MERGE_METHOD: REBASE
          PRESET: DEPENDABOT_PATCH

First I check to make sure the PR is opened by dependabot, if not then it skips the action. Next I wait for the Unit tests job to pass. If that's successful, then I use the merge action to merge any patch updates through.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions